Function at 0x485910
Capabilities:
Write file on windows

Disassembly:
push ebx
sub esp, 0x18
mov dword [esp], 2
lea ebx, [esp + 0x24]
call fcn.00499490
mov dword [esp + 8], 0x1b
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], str.Mingw_w64_runtime_failure:_n
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call fcn.00499490
mov edx, dword [esp + 0x20]
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.msvcrt.dll_vfprintf
call sub.msvcrt.dll_abort
lea esi, [esi]
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x30
mov esi, dword [0x539904]
test esi, esi
jle 0x485a90
mov eax, dword [0x539908]
xor ecx, ecx
add eax, 0xc
mov edx, dword [eax]
cmp ebx, edx
jb 0x4859a4
mov edi, dword [eax + 4]
add edx, dword [edi + 8]
cmp ebx, edx
jb 0x485a27
add ecx, 1
add eax, 0x14
cmp ecx, esi
jne 0x485990
mov dword [esp], ebx
call fcn.00486360
mov edi, eax
test eax, eax
je 0x485ab7
mov eax, dword [0x539908]
lea ebx, [esi + esi*4]
shl ebx, 2
add eax, ebx
mov dword [eax + 0x10], edi
mov dword [eax], 0
call fcn.004864a0
mov edx, dword [0x539908]
add eax, dword [edi + 0xc]
mov dword [edx + ebx + 0xc], eax
lea edx, [esp + 0x14]
mov dword [esp + 8], 0x1c
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
sub esp, 0xc
test eax, eax
je 0x485a97
mov eax, dword [esp + 0x28]
lea edx, [eax - 0x40]
and edx, 0xffffffbf
je 0x485a20
lea edx, [eax - 4]
and edx, 0xfffffffb
jne 0x485a30
add dword [0x539904], 1
add esp, 0x30
pop ebx
pop esi
pop edi
ret
cmp eax, 2
mov edx, 4
mov eax, 0x40
mov ecx, dword [esp + 0x20]
cmove eax, edx
mov edx, dword [esp + 0x14]
add ebx, dword [0x539908]
mov dword [ebx + 8], ecx
mov dword [ebx + 4], edx
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
sub esp, 0x10
test eax, eax
jne 0x485a20
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.__VirtualProtect_failed_with_code_0x_x
mov dword [esp + 4], eax
call fcn.00485910
lea esi, [esi]
lea esi, [esi]
xor esi, esi
jmp 0x4859ae
mov eax, dword [0x539908]
mov eax, dword [eax + ebx + 0xc]
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.00485910
mov dword [esp + 4], ebx
mov dword [esp], str.Address__p_has_no_image_section
call fcn.00485910
lea esi, [esi]
nop
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov edi, dword [0x539900]
test edi, edi
je 0x485af0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [0x539900], 1
call fcn.004863e0
lea eax, [eax + eax*4]
lea eax, [eax*4 + 0x1b]
shr eax, 4
shl eax, 4
call fcn.00486630
mov dword [0x539904], 0
sub esp, eax
lea eax, [esp + 0x23]
and eax, 0xfffffff0
mov dword [0x539908], eax
mov eax, 0x506fe0
sub eax, 0x506fe0
cmp eax, 7
jle 0x485ae3
mov edx, dword [0x506fe0]
cmp eax, 0xb
jg 0x485c00
mov ebx, 0x506fe0
mov eax, dword [ebx]
test eax, eax
jne 0x485d7d
mov eax, dword [ebx + 4]
test eax, eax
jne 0x485d7d
mov eax, dword [ebx + 8]
cmp eax, 1
jne 0x485dbf
add ebx, 0xc
cmp ebx, 0x506fe0
jae 0x485ae3
mov dword [ebp - 0x34], edi
lea esi, [esi]
mov edi, dword [ebx + 4]
mov ecx, dword [ebx + 8]
lea eax, [edi + 0x400000]
movzx edx, cl
mov dword [ebp - 0x30], eax
mov eax, dword [ebx]
lea esi, [eax + 0x400000]
mov eax, dword [eax + 0x400000]
mov dword [ebp - 0x2c], eax
cmp cl, 0x10
je 0x485c50
cmp edx, 0x20
jne 0x485c30
mov eax, dword [ebp - 0x2c]
sub eax, esi
add eax, dword [edi + 0x400000]
and ecx, 0xe0
mov esi, eax
jne 0x485d60
test eax, eax
js 0x485d60
mov dword [esp + 0x10], esi
mov eax, dword [ebp - 0x2c]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov dword [esp], str._d_bit_pseudo_relocation_at__p_out_of_range__targeting__p__yielding_the_value__p._n
call fcn.00485910
lea esi, [esi]
test edx, edx
jne 0x485d78
mov eax, dword [0x506fe4]
mov ebx, 0x506fec
mov ecx, eax
or ecx, dword [0x506fe8]
je 0x485b4f
mov ebx, 0x506fe0
jmp 0x485b5c
cmp edx, 8
je 0x485d10
mov dword [esp + 4], edx
mov dword [esp], str.__Unknown_pseudo_relocation_bit_size__d._n
call fcn.00485910
lea esi, [esi]
movzx eax, word [edi + 0x400000]
and ecx, 0xe0
test ax, ax
jns 0x485c67
or eax, 0xffff0000
sub eax, esi
mov esi, dword [ebp - 0x2c]
add esi, eax
test ecx, ecx
jne 0x485c8a
cmp esi, 0xffff8000
jl 0x485bda
cmp esi, 0xffff
jg 0x485bda
mov eax, dword [ebp - 0x30]
call 0x485970
mov word [edi + 0x400000], si
add ebx, 0xc
cmp ebx, 0x506fe0
jb 0x485b88
mov edi, dword [ebp - 0x34]
mov edx, dword [0x539904]
test edx, edx
jle 0x485ae3
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualProtect]
lea esi, [ebp - 0x1c]
lea esi, [esi]
mov edx, dword [0x539908]
lea eax, [edi + edi*4]
lea eax, [edx + eax*4]
mov edx, dword [eax]
test edx, edx
je 0x485cf4
mov dword [esp + 0xc], esi
mov dword [esp + 8], edx
mov edx, dword [eax + 8]
mov dword [esp + 4], edx
mov eax, dword [eax + 4]
mov dword [esp], eax
call ebx
sub esp, 0x10
add edi, 1
cmp edi, dword [0x539904]
jl 0x485cc8
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [edi + 0x400000]
and ecx, 0xe0
test al, al
jns 0x485d26
or eax, 0xffffff00
sub eax, esi
mov esi, dword [ebp - 0x2c]
add esi, eax
test ecx, ecx
jne 0x485d46
cmp esi, 0xff
jg 0x485bda
cmp esi, 0xffffff80
jl 0x485bda
mov eax, dword [ebp - 0x30]
call 0x485970
mov eax, esi
mov byte [edi + 0x400000], al
jmp 0x485c99
mov eax, dword [ebp - 0x30]
call 0x485970
mov dword [edi + 0x400000], esi
jmp 0x485c99
mov ebx, 0x506fe0
cmp ebx, 0x506fe0
jae 0x485ae3
mov dword [ebp - 0x2c], edi
lea esi, [esi]
mov esi, dword [ebx + 4]
mov edi, dword [ebx]
add ebx, 8
add edi, dword [esi + 0x400000]
lea eax, [esi + 0x400000]
call 0x485970
mov dword [esi + 0x400000], edi
cmp ebx, 0x506fe0
jb 0x485d90
mov edi, dword [ebp - 0x2c]
jmp 0x485cab
mov dword [esp + 4], eax
mov dword [esp], str.__Unknown_pseudo_relocation_protocol_version__d._n
call fcn.00485910
nop
sub esp, 0x3c
mov eax, dword [0x53990c]
fld qword [esp + 0x48]
fld qword [esp + 0x50]
fld qword [esp + 0x58]
test eax, eax
je 0x485e18
fxch st(2)
mov edx, dword [esp + 0x40]
fstp qword [esp + 0x18]
fstp qword [esp + 0x20]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x44]
fstp qword [esp + 0x28]
mov dword [esp + 0x14], edx
lea edx, [esp + 0x10]
mov dword [esp], edx
call eax
jmp 0x485e1e
fstp st(0)
fstp st(0)
fstp st(0)
add esp, 0x3c
ret