Function at 0x59a370
Capabilities:
Write file on windows

Disassembly:
push ecx
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov ebp, dword [edi + 0x44]
mov ecx, dword [edi + 0x30]
mov esi, dword [edi + 0xdc]
sub ebp, ecx
test esi, esi
je 0x59aa7f
mov eax, dword [edi + 0xe0]
test eax, eax
je 0x59aa7f
mov eax, dword [edi + 0xe4]
test eax, eax
je 0x59aa7f
mov eax, dword [edi + 0xe8]
test eax, eax
je 0x59aa7f
mov ebx, dword [edi + 0x40]
mov ecx, dword [edi + 0x24]
mov eax, ebp
sub eax, ebx
lea eax, [eax + ecx + 0x24]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi - 8], eax
mov eax, dword [edi + 0x28]
mov esi, dword [edi + 0xe0]
add eax, ebp
push eax
sub esi, 8
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0x2c]
mov esi, dword [edi + 0xe4]
add eax, ebp
push eax
sub esi, 8
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0x44]
mov esi, dword [edi + 0xe8]
push eax
sub esi, 8
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0x8c]
test eax, eax
jne 0x59a460
mov eax, dword [edi + 0x14]
cmp eax, 0x40
je 0x59a460
cmp eax, 0x80
je 0x59a460
mov esi, dword [edi + 8]
cmp esi, 0x3e8
je 0x59a4e5
test esi, esi
je 0x59a4e5
mov edx, dword [edi + 0x7c]
push 0
push 0x3e8
push 0
push edx
call fcn.005e9a70
push 0
push esi
push edx
push eax
call fcn.005e9080
inc eax
jmp 0x59a4e2
mov eax, dword [edi + 0x78]
test eax, eax
jne 0x59a470
mov eax, dword [edi + 0x80]
mov dword [edi + 0x78], eax
mov esi, dword [edi + 0xc]
cmp esi, 0x3e8
jne 0x59a482
mov eax, dword [edi + 0x78]
test eax, eax
jne 0x59a4a9
mov eax, dword [edi + 0x7c]
test eax, eax
je 0x59a4a9
test esi, esi
je 0x59a4a9
push 0
push 0x3e8
push 0
push eax
call fcn.005e9a70
push 0
push esi
push edx
push eax
call fcn.005e9080
mov dword [edi + 0x78], eax
mov eax, dword [edi + 0x14]
cmp eax, 0x40
je 0x59a4b8
cmp eax, 0x80
jne 0x59a4e5
mov esi, dword [edi + 0x10]
test esi, esi
je 0x59a4e5
mov eax, dword [edi + 0x84]
test eax, eax
je 0x59a4e5
push 0
push 0x3e8
push 0
push eax
call fcn.005e9a70
push 0
push esi
push edx
push eax
call fcn.005e9080
mov dword [edi + 0x78], eax
mov esi, dword [edi + 0xf4]
test esi, esi
je 0x59a514
mov eax, dword [edi + 0x78]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi + 0x14], eax
mov eax, dword [edi + 0x64]
test eax, eax
jne 0x59a514
mov esi, dword [edi + 0xf4]
push 1
add esi, 0x20
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [edi + 0xf8]
test ebx, ebx
je 0x59a54e
cmp byte [ebx], 0
mov eax, dword [edi + 0x7c]
push eax
jne 0x59a531
call sub.WS2_32.dll_htonl
mov dword [ebx + 0x10], eax
jmp 0x59a54e
call sub.WS2_32.dll_htonl
mov ebp, eax
xor eax, eax
push eax
xor esi, esi
call sub.WS2_32.dll_htonl
xor ecx, ecx
or esi, eax
or ebp, ecx
mov dword [ebx + 0x18], esi
mov dword [ebx + 0x1c], ebp
mov esi, dword [edi + 0xf4]
test esi, esi
je 0x59a576
push 0xf
call sub.WS2_32.dll_htonl
mov edx, dword [esp + 0x1c]
mov dword [esi], eax
mov esi, dword [edi + 0xf4]
push edx
add esi, 0xc
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0xfc]
test eax, eax
je 0x59a63d
mov ecx, dword [edi + 0xdc]
mov ebx, dword [esp + 0x18]
sub eax, ecx
push 0
add eax, 8
add ecx, 0xfffffff8
mov esi, eax
lea eax, [esp + 0x14]
push eax
push esi
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x59aa7f
mov eax, dword [esp + 0x10]
cmp esi, eax
jne 0x59aa7f
mov ebp, dword [esp + 0x20]
mov esi, 0
push ebx
mov ecx, dword [ebp]
add ecx, eax
mov dword [ebp], ecx
mov eax, dword [ebp + 4]
adc eax, esi
mov ecx, edi
mov dword [ebp + 4], eax
call fcn.0059ad70
mov ecx, dword [ebp]
lea edx, [esp + 0x10]
add ecx, 0x24
push 0
mov dword [ebp], ecx
mov eax, dword [ebp + 4]
adc eax, esi
push edx
mov dword [ebp + 4], eax
mov ecx, dword [edi + 0x40]
mov esi, dword [edi + 0xe8]
mov eax, dword [edi + 0xfc]
sub esi, ecx
add ecx, eax
sub esi, eax
push esi
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x59aa7f
mov eax, dword [esp + 0x10]
cmp esi, eax
jne 0x59aa7f
mov ecx, dword [ebp]
add ecx, eax
mov dword [ebp], ecx
mov eax, dword [ebp + 4]
adc eax, 0
mov dword [ebp + 4], eax
jmp 0x59a6f1
mov eax, dword [edi + 0xdc]
mov esi, dword [edi + 0xe0]
mov ebx, dword [esp + 0x18]
lea ecx, [esp + 0x10]
sub esi, eax
push 0
push ecx
add eax, 0xfffffff8
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x59aa7f
mov eax, dword [esp + 0x10]
cmp esi, eax
jne 0x59aa7f
mov ebp, dword [esp + 0x20]
mov esi, 0
push ebx
mov ecx, dword [ebp]
add ecx, eax
mov dword [ebp], ecx
mov eax, dword [ebp + 4]
adc eax, esi
mov ecx, edi
mov dword [ebp + 4], eax
call fcn.0059ad70
mov ecx, dword [ebp]
lea edx, [esp + 0x10]
add ecx, 0x24
push 0
mov dword [ebp], ecx
mov eax, dword [ebp + 4]
adc eax, esi
push edx
mov dword [ebp + 4], eax
mov eax, dword [edi + 0xe0]
mov esi, dword [edi + 0xe8]
sub esi, eax
add eax, 0xfffffff8
add esi, 8
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x59aa7f
mov eax, dword [esp + 0x10]
cmp esi, eax
jne 0x59aa7f
mov ecx, dword [ebp]
add ecx, eax
mov dword [ebp], ecx
mov eax, dword [ebp + 4]
adc eax, 0
mov dword [ebp + 4], eax
mov esi, dword [edi + 0x34]
mov ecx, dword [edi + 0xec]
lea eax, [esp + 0x10]
push 0
push eax
push esi
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x59aa7f
mov eax, dword [esp + 0x10]
cmp esi, eax
jne 0x59aa7f
mov ecx, dword [ebp]
add ecx, eax
mov dword [ebp], ecx
mov ebx, dword [ebp + 4]
adc ebx, 0
mov dword [ebp + 4], ebx
mov eax, dword [edi + 0x54]
mov esi, dword [edi + 0x50]
mov edx, dword [edi + 0x4c]
mov ecx, dword [edi + 0x48]
mov ebx, dword [edi + 0x58]
add eax, esi
mov esi, dword [edi + 0x88]
add eax, edx
add eax, ecx
add eax, ebx
add eax, esi
push eax
mov dword [esp + 0x24], eax
call fcn.005ffe3f
mov esi, eax
add esp, 4
test esi, esi
mov dword [esp + 0x1c], esi
je 0x59aa7f
mov eax, dword [edi + 0x4c]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov edx, dword [str.stts]
add esi, 4
push 0
mov dword [esi], edx
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0xbc]
push eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [edi + 0xa4]
add esi, 4
test ebx, ebx
je 0x59a7cb
mov eax, dword [ebx]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [ebx + 4]
push eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [ebx + 8]
add esi, 4
test ebx, ebx
jne 0x59a7a9
mov eax, dword [edi + 0x64]
test eax, eax
je 0x59a826
mov eax, dword [edi + 0x48]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [str.stss]
add esi, 4
push 0
mov dword [esi], eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0xc4]
push eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [edi + 0xb4]
add esi, 4
test ebx, ebx
je 0x59a826
mov eax, dword [ebx + 8]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [ebx + 0xc]
add esi, 4
test ebx, ebx
jne 0x59a811
mov eax, dword [edi + 0x88]
test eax, eax
je 0x59a88f
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ecx, dword [str.ctts]
add esi, 4
push 0
mov dword [esi], ecx
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0xa0]
push eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [edi + 0x98]
add esi, 4
test ebx, ebx
je 0x59a88f
mov eax, dword [ebx]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [ebx + 4]
push eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [ebx + 8]
add esi, 4
test ebx, ebx
jne 0x59a86d
mov eax, dword [edi + 0x50]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov edx, dword [str.stsc]
add esi, 4
push 0
mov dword [esi], edx
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0xc0]
push eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [edi + 0xac]
add esi, 4
test ebx, ebx
je 0x59a8ff
mov eax, dword [ebx]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [ebx + 4]
push eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [ebx + 8]
push eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [ebx + 0xc]
add esi, 4
test ebx, ebx
jne 0x59a8cf
mov eax, dword [edi + 0x54]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [str.stsz]
add esi, 4
push 0
mov dword [esi], eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
push 0
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0x5c]
push eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0x5c]
add esi, 4
xor ebx, ebx
test eax, eax
jbe 0x59a95f
mov ecx, dword [edi + 0x60]
mov eax, dword [ecx + ebx*4]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0x5c]
add esi, 4
inc ebx
cmp ebx, eax
jb 0x59a946
mov eax, dword [edi + 0x58]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0xc8]
add esi, 4
test eax, eax
mov eax, str.co64
jne 0x59a981
mov eax, str.stco
mov edx, dword [eax]
push 0
mov dword [esi], edx
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov eax, dword [edi + 0xc4]
push eax
add esi, 4
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [edi + 0xb4]
add esi, 4
test ebx, ebx
je 0x59a9e7
mov eax, dword [edi + 0xc8]
test eax, eax
je 0x59a9d3
mov eax, dword [ebx]
mov edx, dword [ebx + 4]
mov ecx, 0x20
call fcn.005eb280
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
add esi, 4
mov eax, dword [ebx]
push eax
call sub.WS2_32.dll_htonl
mov dword [esi], eax
mov ebx, dword [ebx + 0xc]
add esi, 4
test ebx, ebx
jne 0x59a9af
mov ebx, dword [esp + 0x20]
mov esi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x10]
push 0
push eax
push ebx
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x59aa7f
mov eax, dword [esp + 0x10]
cmp ebx, eax
jne 0x59aa7f
mov ebx, dword [ebp]
push esi
add ebx, eax
mov dword [ebp], ebx
mov edx, dword [ebp + 4]
adc edx, 0
mov dword [ebp + 4], edx
call fcn.005ffe68
mov eax, dword [edi + 0xe8]
mov ecx, dword [edi + 0x30]
mov esi, dword [edi + 0xdc]
mov edi, dword [edi + 0x24]
lea edx, [eax + ecx]
add esp, 4
lea ebx, [edi + esi]
cmp ebx, edx
jbe 0x59aa7f
sub edi, eax
lea eax, [esp + 0x10]
sub edi, ecx
mov ecx, dword [esp + 0x18]
add edi, esi
push 0
push eax
add edx, 0xfffffff8
push edi
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x59aa7f
mov eax, dword [esp + 0x10]
cmp edi, eax
jne 0x59aa7f
mov ecx, dword [ebp]
add ecx, eax
mov dword [ebp], ecx
mov eax, dword [ebp + 4]
adc eax, 0
mov dword [ebp + 4], eax
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 0xc