Function at 0x10022570
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x14
xor ecx, ecx
push ebx
push ebp
mov ebp, dword [esp + 0x28]
push esi
mov esi, dword [esp + 0x34]
push edi
mov edi, dword [esp + 0x2c]
cmp dword [esi + 0xb7a4], ecx
jne 0x100225e5
cmp dword [esi + 0x4e88], ecx
je 0x100225e5
mov ebx, dword [esp + 0x28]
mov eax, edi
or eax, ebp
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], ebp
je 0x100225e5
push esi
call fcn.100221b0
movsx ecx, byte [ebx]
push esi
push ecx
mov dword [esp + 0x38], eax
call fcn.100221d0
mov dl, byte [esp + 0x38]
mov al, byte [ebx]
mov ecx, dword [esp + 0x24]
xor al, dl
mov byte [ebx], al
mov eax, dword [esp + 0x20]
add esp, 0xc
inc ebx
add eax, 0xffffffff
adc ecx, 0xffffffff
mov dword [esp + 0x14], eax
or eax, ecx
mov dword [esp + 0x18], ecx
jne 0x100225a7
xor ecx, ecx
mov eax, dword [esi + 0x8f4]
mov ebx, 3
cmp eax, ecx
je 0x1002269a
cmp ebp, ecx
jl 0x1002269a
jg 0x1002260a
cmp edi, ecx
jbe 0x1002269a
mov ecx, dword [esi + 0x90c]
mov edx, dword [esi + 0x904]
lea eax, [esp + 0x10]
mov dword [esp + 0x38], edi
push eax
mov eax, dword [esi + 0x900]
push ecx
mov ecx, 0x20
mov dword [esp + 0x18], ebx
call fcn.1003a5b0
mov edx, dword [esi + 0x900]
push eax
mov eax, dword [esi + 0x8f8]
push edx
mov edx, dword [esi + 0x8fc]
mov ecx, 0x20
call fcn.1003a5b0
mov edx, dword [esp + 0x38]
push eax
mov eax, dword [esi + 0x8f8]
lea ecx, [esp + 0x4c]
push eax
push ecx
push edx
push 2
call dword [esi + 0x908]
mov eax, dword [esp + 0x10]
test eax, eax
jl 0x1002268f
cmp eax, 2
jg 0x1002268f
mov dword [esi + 0xa0], 1
pop edi
pop esi
xor eax, eax
pop ebp
xor edx, edx
pop ebx
add esp, 0x14
ret
push esi
call fcn.10014e00
add esp, 4
xor ecx, ecx
cmp dword [esi + 0x8ec], ecx
je 0x1002276a
mov ecx, dword [esi + 0x90c]
mov edx, dword [esi + 0x904]
lea eax, [esp + 0x10]
mov dword [esp + 0x38], edi
push eax
mov eax, dword [esi + 0x900]
push ecx
mov ecx, 0x20
mov dword [esp + 0x18], ebx
call fcn.1003a5b0
mov edx, dword [esi + 0x900]
push eax
mov eax, dword [esi + 0x8f8]
push edx
mov edx, dword [esi + 0x8fc]
mov ecx, 0x20
call fcn.1003a5b0
mov edx, dword [esp + 0x38]
push eax
mov eax, dword [esi + 0x8f8]
lea ecx, [esp + 0x4c]
push eax
push ecx
push edx
push 1
call dword [esi + 0x908]
mov eax, dword [esp + 0x10]
cmp eax, ebx
ja case.0x10022714.0
jmp dword [eax*4 + 0x10022b0c]
mov eax, dword [esp + 0x38]
cmp eax, edi
jne 0x10022adf
mov ecx, dword [esi + 0x900]
push esi
add ecx, eax
mov dword [esi + 0x900], ecx
mov eax, dword [esi + 0x904]
adc eax, 0
mov dword [esi + 0x904], eax
call fcn.10014e00
mov eax, dword [esp + 0x3c]
add esp, 4
xor edx, edx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov dword [esi + 0xa0], 1
jmp case.0x10022714.0
mov eax, dword [esp + 0x34]
cmp eax, ecx
je 0x10022af6
mov eax, dword [eax]
cmp eax, 0xffffffff
je 0x10022af6
test byte [esi + 0x4ef5], 0x80
je 0x10022aba
mov eax, dword [esi + 0xa8]
mov dword [esp + 0x14], ecx
cmp eax, 0xffffffff
mov dword [esp + 0x18], ecx
jne 0x1002296e
mov ecx, dword [esi + 0x4e90]
mov eax, dword [esp + 0x28]
push esi
push ecx
mov dword [esp + 0x34], eax
mov ebx, ebp
call fcn.1001f260
add esp, 8
cmp edx, ebp
jl 0x1002281e
jg 0x100227c9
cmp eax, edi
jb 0x1002281e
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x28]
lea edx, [esp + 0x38]
push 0
push edx
mov edx, dword [ecx]
push edi
push eax
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10022955
cmp dword [esp + 0x38], edi
jne 0x10022955
mov ecx, dword [esi + 0x4f18]
mov dword [esp + 0x14], edi
add ecx, edi
mov dword [esp + 0x18], ebp
mov dword [esi + 0x4f18], ecx
mov eax, dword [esi + 0x4f1c]
adc eax, ebp
mov dword [esi + 0x4f1c], eax
jmp 0x10022955
test ebp, ebp
jl 0x100228e9
jg 0x10022834
cmp edi, 0x200
jb 0x100228e9
mov ebp, dword [esp + 0x34]
push esi
push 0
push 0x200
push ebp
push 0
call fcn.10020210
add esp, 0x14
test eax, eax
jne 0x100228c4
mov ecx, dword [esp + 0x2c]
mov edx, dword [ebp]
push eax
lea eax, [esp + 0x3c]
push eax
push 0x200
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x100228c4
mov ecx, dword [esp + 0x38]
mov eax, 0x200
cmp ecx, eax
jne 0x100228c4
mov ecx, dword [esi + 0x4f18]
add ecx, eax
mov dword [esi + 0x4f18], ecx
mov edx, dword [esi + 0x4f1c]
mov ecx, 0
adc edx, ecx
add edi, 0xfffffe00
mov dword [esi + 0x4f1c], edx
mov edx, dword [esp + 0x14]
adc ebx, 0xffffffff
add edx, eax
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x18]
adc edx, ecx
mov ecx, dword [esp + 0x2c]
add ecx, eax
mov dword [esp + 0x18], edx
mov dword [esp + 0x2c], ecx
jmp 0x100228c8
xor edi, edi
xor ebx, ebx
push esi
call fcn.10014e00
add esp, 4
test ebx, ebx
jg 0x10022834
jl 0x100228ed
cmp edi, 0x200
jae 0x10022834
jmp 0x100228ed
mov ebp, dword [esp + 0x34]
mov eax, edi
or eax, ebx
je 0x10022955
push esi
push ebx
push edi
push ebp
push 0
call fcn.10020210
add esp, 0x14
test eax, eax
jne 0x10022955
mov edx, dword [esp + 0x2c]
lea ecx, [esp + 0x38]
push eax
mov eax, dword [ebp]
push ecx
push edi
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10022955
cmp dword [esp + 0x38], edi
jne 0x10022955
mov ebp, dword [esi + 0x4f18]
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
add ebp, edi
mov dword [esi + 0x4f18], ebp
mov edx, dword [esi + 0x4f1c]
adc edx, ebx
add ecx, edi
adc eax, ebx
mov dword [esi + 0x4f1c], edx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], eax
push esi
call fcn.10014e00
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov ecx, dword [esp + 0x28]
mov ebx, edi
test ebp, ebp
mov dword [esp + 0x2c], ecx
jl 0x10022aaa
jg 0x1002298a
test edi, edi
jbe 0x10022aaa
push esi
call fcn.10020aa0
add esp, 4
cmp edx, ebp
mov edi, eax
mov dword [esp + 0x20], edx
jl 0x10022a04
jg 0x100229a3
cmp edi, ebx
jb 0x10022a04
mov eax, dword [esp + 0x2c]
mov ecx, dword [esi + 0xa8]
lea edx, [esp + 0x38]
push 0
push edx
push ebx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10022a8f
cmp dword [esp + 0x38], ebx
jne 0x10022a8f
mov edi, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov ecx, dword [esi + 0x4f18]
add edi, ebx
adc edx, ebp
add ecx, ebx
mov dword [esi + 0x4f18], ecx
mov eax, dword [esi + 0x4f1c]
adc eax, ebp
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], edx
mov dword [esi + 0x4f1c], eax
jmp 0x10022a8b
mov eax, dword [esp + 0x2c]
mov ecx, dword [esi + 0xa8]
lea edx, [esp + 0x38]
push 0
push edx
push edi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10022a73
mov eax, dword [esp + 0x38]
cdq
cmp eax, edi
jne 0x10022a73
mov eax, dword [esp + 0x20]
cmp edx, eax
jne 0x10022a73
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
sub ebx, edi
sbb ebp, eax
add ecx, edi
adc edx, eax
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x18], edx
mov edx, dword [esi + 0x4f18]
add ecx, edi
add edx, edi
mov dword [esp + 0x2c], ecx
mov dword [esi + 0x4f18], edx
mov ecx, dword [esi + 0x4f1c]
adc ecx, eax
mov dword [esi + 0x4f1c], ecx
jmp 0x10022a77
xor ebx, ebx
xor ebp, ebp
mov edx, dword [esp + 0x34]
push esi
push edx
push 0
call fcn.10020bc0
add esp, 0xc
test eax, eax
je 0x10022a8f
xor ebx, ebx
xor ebp, ebp
push esi
call fcn.10014e00
add esp, 4
test ebp, ebp
jg 0x1002298a
jl 0x10022aaa
test ebx, ebx
ja 0x1002298a
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov edx, dword [esp + 0x28]
push ecx
lea ecx, [esp + 0x3c]
push ecx
push edi
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je case.0x10022714.0
cmp dword [esp + 0x38], edi
je 0x10022adf
mov dword [esp + 0x38], 0
push esi
call fcn.10014e00
mov eax, dword [esp + 0x3c]
add esp, 4
xor edx, edx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
push esi
call fcn.10014e00
add esp, 4
xor eax, eax
xor edx, edx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret