Function at 0x403690
Capabilities:
Write file on windows

Disassembly:
push ebx
sub esp, 0x18
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x1b
mov dword [esp + 4], 1
lea ebx, [esp + 0x24]
mov dword [esp], str.Mingw_w64_runtime_failure:_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [esp + 0x20]
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_vfprintf
call sub.msvcrt.dll_abort
jmp 0x4036f0
push edi
push esi
push ebx
sub esp, 0x30
mov esi, dword [0x40ace0]
test esi, esi
jle 0x4037dd
mov edi, dword [0x40ace4]
xor ebx, ebx
lea edx, [edi + 4]
nop
mov ecx, dword [edx]
cmp ecx, eax
ja 0x403724
mov edi, dword [edx + 4]
add ecx, dword [edi + 8]
cmp eax, ecx
jb 0x4037d6
add ebx, 1
add edx, 0xc
cmp ebx, esi
jne 0x403710
mov dword [esp], eax
mov ebx, eax
call fcn.00404020
test eax, eax
mov edi, eax
je 0x40381a
lea ebx, [esi + esi*2]
mov esi, dword [0x40ace4]
shl ebx, 2
add esi, ebx
mov dword [esi + 8], eax
mov dword [esi], 0
call fcn.00404120
add eax, dword [edi + 0xc]
mov dword [esi + 4], eax
lea eax, [esp + 0x14]
mov dword [esp + 8], 0x1c
mov dword [esp + 4], eax
mov eax, dword [0x40ace4]
mov eax, dword [eax + ebx + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
sub esp, 0xc
test eax, eax
je 0x4037fa
mov eax, dword [esp + 0x28]
lea edx, [eax - 4]
and edx, 0xfffffffb
je 0x4037cf
sub eax, 0x40
and eax, 0xffffffbf
je 0x4037cf
mov eax, dword [esp + 0x20]
add ebx, dword [0x40ace4]
mov dword [esp + 8], 0x40
mov dword [esp + 4], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0xc], ebx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
sub esp, 0x10
test eax, eax
je 0x4037e4
add dword [0x40ace0], 1
add esp, 0x30
pop ebx
pop esi
pop edi
ret
xor esi, esi
jmp 0x40372e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.__VirtualProtect_failed_with_code_0x_x
mov dword [esp + 4], eax
call fcn.00403690
mov eax, dword [0x40ace4]
mov eax, dword [eax + ebx + 4]
mov dword [esp + 8], eax
mov eax, dword [edi + 8]
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov dword [esp + 4], eax
call fcn.00403690
mov dword [esp + 4], ebx
mov dword [esp], str.Address__p_has_no_image_section
call fcn.00403690
lea esi, [esi]
mov eax, dword [0x40acdc]
test eax, eax
je 0x403840
ret
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov dword [0x40acdc], 1
call fcn.00404070
lea eax, [eax + eax*2]
lea eax, [eax*4 + 0x1e]
and eax, 0xfffffff0
call fcn.00404250
mov dword [0x40ace0], 0
sub esp, eax
lea eax, [esp + 0x1f]
and eax, 0xfffffff0
mov dword [0x40ace4], eax
mov eax, 0x4081a8
sub eax, 0x4081a8
cmp eax, 7
jle 0x403930
cmp eax, 0xb
jle 0x4039f3
mov eax, dword [0x4081a8]
test eax, eax
jne 0x403938
mov eax, dword [0x4081ac]
test eax, eax
jne 0x403938
mov edi, dword [0x4081b0]
mov ebx, 0x4081b4
test edi, edi
je 0x4039f8
mov ebx, 0x4081a8
mov eax, dword [ebx + 8]
cmp eax, 1
jne 0x403ad7
add ebx, 0xc
cmp ebx, 0x4081a8
jae 0x403930
mov edx, dword [ebx]
mov ecx, dword [ebx + 4]
mov eax, dword [edx + 0x400000]
lea esi, [ecx + 0x400000]
mov dword [ebp - 0x3c], eax
movzx eax, byte [ebx + 8]
cmp eax, 0x10
je 0x403a12
cmp eax, 0x20
je 0x403a96
cmp eax, 8
je 0x403a67
mov dword [esp + 4], eax
mov dword [esp], str.__Unknown_pseudo_relocation_bit_size__d._n
call fcn.00403690
lea esi, [esi]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, 0x4081a8
cmp ebx, 0x4081a8
jae 0x403930
mov esi, dword [ebx + 4]
mov edx, dword [ebx]
add ebx, 8
add edx, dword [esi + 0x400000]
lea eax, [esi + 0x400000]
mov dword [ebp - 0x34], edx
call 0x4036f0
mov eax, dword [ebp - 0x34]
cmp ebx, 0x4081a8
mov dword [esi + 0x400000], eax
jb 0x403945
mov eax, dword [0x40ace0]
xor ebx, ebx
test eax, eax
jg 0x40398b
jmp 0x403930
add ebx, 1
cmp ebx, dword [0x40ace0]
jge 0x403930
lea edi, [ebx + ebx*2]
mov eax, dword [0x40ace4]
lea esi, [edi*4]
add eax, esi
mov edx, dword [eax]
test edx, edx
je 0x403980
lea ecx, [ebp - 0x34]
mov dword [esp + 8], 0x1c
mov dword [esp + 4], ecx
mov eax, dword [eax + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
sub esp, 0xc
test eax, eax
je 0x403ab2
lea eax, [ebp - 0x38]
mov dword [esp + 0xc], eax
mov eax, dword [0x40ace4]
mov eax, dword [eax + edi*4]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
sub esp, 0x10
jmp 0x403980
mov ebx, 0x4081a8
mov esi, dword [ebx]
test esi, esi
jne 0x40393d
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x4038d0
jmp 0x40393d
movzx eax, word [ecx + 0x400000]
mov dword [ebp - 0x40], ecx
mov edi, eax
or edi, 0xffff0000
cmp word [ecx + 0x400000], 0
cmovs eax, edi
mov edi, dword [ebp - 0x3c]
sub eax, 0x400000
sub eax, edx
add edi, eax
mov eax, esi
mov dword [ebp - 0x34], edi
call 0x4036f0
movzx eax, word [ebp - 0x34]
mov ecx, dword [ebp - 0x40]
mov word [ecx + 0x400000], ax
add ebx, 0xc
cmp ebx, 0x4081a8
jb 0x4038e7
jmp 0x403972
movzx eax, byte [esi]
mov edi, dword [ebp - 0x3c]
mov ecx, eax
or ecx, 0xffffff00
cmp byte [esi], 0
cmovs eax, ecx
sub eax, 0x400000
sub eax, edx
add edi, eax
mov eax, esi
mov dword [ebp - 0x34], edi
call 0x4036f0
movzx eax, byte [ebp - 0x34]
mov byte [esi], al
jmp 0x403a53
mov eax, dword [esi]
mov edi, dword [ebp - 0x3c]
sub eax, 0x400000
sub eax, dword [ebx]
add edi, eax
mov eax, esi
mov dword [ebp - 0x34], edi
call 0x4036f0
mov dword [esi], edi
jmp 0x403a53
mov ecx, dword [0x40ace4]
add ecx, esi
mov eax, dword [ecx + 4]
mov dword [esp + 8], eax
mov eax, dword [ecx + 8]
mov eax, dword [eax + 8]
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov dword [esp + 4], eax
call fcn.00403690
mov dword [esp + 4], eax
mov dword [esp], str.__Unknown_pseudo_relocation_protocol_version__d._n
call fcn.00403690
nop
nop
nop
nop
nop
nop
nop
nop
nop
push ebp
mov ebp, esp
push ebx
sub esp, 0x14
mov ebx, dword [ebp + 8]
mov eax, dword [ebx]
mov eax, dword [eax]
cmp eax, 0xc0000091
ja 0x403b50
cmp eax, 0xc000008d
jae 0x403bc0
cmp eax, 0xc0000005
jne 0x403bf4
mov dword [esp + 4], 0
mov dword [esp], 0xb
call sub.msvcrt.dll_signal
cmp eax, 1
je 0x403c50
test eax, eax
je 0x403b69
mov dword [esp], 0xb
call eax
jmp 0x403baa
cmp eax, 0xc0000094
je 0x403b80
cmp eax, 0xc0000096
je 0x403bff
cmp eax, 0xc0000093
je 0x403bc0
mov eax, dword [0x40acec]
test eax, eax
je 0x403baf
mov dword [ebp + 8], ebx
mov ebx, dword [ebp - 4]
leave
jmp eax
mov dword [esp + 4], 0
mov dword [esp], 8
call sub.msvcrt.dll_signal
cmp eax, 1
je 0x403c70
test eax, eax
je 0x403b69
mov dword [esp], 8
call eax
mov eax, 0xffffffff
mov ebx, dword [ebp - 4]
leave
ret 4
mov dword [esp + 4], 0
mov dword [esp], 8
call sub.msvcrt.dll_signal
cmp eax, 1
jne 0x403b9d
mov dword [esp + 4], 1
mov dword [esp], 8
call sub.msvcrt.dll_signal
call fcn.00403660
jmp 0x403baa
cmp eax, 0xc000001d
jne 0x403b69
mov dword [esp + 4], 0
mov dword [esp], 4
call sub.msvcrt.dll_signal
cmp eax, 1
je 0x403c30
test eax, eax
je 0x403b69
mov dword [esp], 4
call eax
jmp 0x403baa
mov dword [esp + 4], 1
mov dword [esp], 4
call sub.msvcrt.dll_signal
jmp 0x403baa
mov dword [esp + 4], 1
mov dword [esp], 0xb
call sub.msvcrt.dll_signal
jmp 0x403baa
mov dword [esp + 4], 1
mov dword [esp], 8
call sub.msvcrt.dll_signal
jmp 0x403baa