Function at 0x415c4f
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor edi, edi
cmp esi, edi
je 0x41657e
mov ebx, dword [ebp + 0xc]
cmp ebx, edi
je 0x41657e
mov ecx, dword [ebp + 0x10]
cmp ecx, edi
je 0x41657e
cmp byte [ebx], 0
je 0x41657e
cmp byte [ecx], 0
je 0x41657e
test word [esi + 0x16c], 0x8000
jne 0x415c9f
push 5
jmp 0x416580
xor eax, eax
test byte [ebp + 0x14], 1
je 0x415cab
inc eax
xor dword [ebp + 0x14], eax
push eax
push dword [0x46d630]
push ecx
push esi
call fcn.00415104
add esp, 0x10
cmp eax, edi
mov dword [ebp - 0x40], eax
je 0x416586
push edi
push edi
push 3
push edi
push 1
push SysReAllocStringLen
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
je 0x416586
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov cl, byte [esi + 0x142]
mov ebx, 0x200
shl ebx, cl
xor edx, edx
mov dword [ebp + 0xc], eax
mov dword [ebp - 0x4c], eax
div ebx
mov dword [ebp - 0x38], edi
cmp edx, edi
mov dword [ebp - 0x18], eax
je 0x415d12
inc dword [ebp - 0x18]
mov eax, dword [ebp + 0x14]
xor edi, edi
mov dword [ebp - 0x10], eax
and dword [ebp - 0x10], 0x200
mov dword [ebp - 0x30], edi
jne 0x415d2c
test ax, 0x100
je 0x415d39
mov edi, dword [ebp - 0x18]
lea edi, [edi*4 + 4]
mov dword [ebp - 0x30], edi
push 4
push dword [0x468014]
lea eax, [esi + 0x124]
push eax
call fcn.00437ceb
add esp, 0xc
test eax, eax
mov eax, dword [ebp + 0xc]
jne 0x415dca
add edi, eax
mov dword [ebp - 0x2c], edi
add edi, 0x144
push edi
mov dword [ebp - 0x38], 1
call fcn.00413f20
test eax, eax
mov dword [ebp - 0x3c], eax
jne 0x415d84
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x416586
mov edi, dword [ebp - 0x3c]
push dword [ebp + 0x10]
mov byte [edi], 0x44
mov byte [edi + 1], 1
call fcn.00437c60
pop ecx
mov ecx, 0x104
cmp eax, ecx
ja 0x415daf
push eax
push dword [ebp + 0x10]
lea eax, [edi + 0x40]
push eax
call fcn.004378f0
jmp 0x415dbc
push ecx
push dword [ebp + 0x10]
lea eax, [edi + 0x40]
push eax
call fcn.00439580
add esp, 0xc
add edi, 0x144
mov dword [ebp + 8], edi
jmp 0x415dd8
add eax, edi
push eax
mov dword [ebp - 0x2c], eax
call fcn.00413f20
mov dword [ebp + 8], eax
xor eax, eax
cmp dword [ebp + 8], eax
mov ecx, 0x10000
mov edx, 0x20000
jne 0x415e4a
cmp dword [ebp + 0xc], eax
jne 0x415d76
cmp dword [ebp - 0x10], eax
je 0x415dfa
xor dword [ebp + 0x14], 0x200
mov eax, pe_nt_image_headers32
test dword [ebp + 0x14], eax
je 0x415e07
xor dword [ebp + 0x14], eax
test dword [ebp + 0x14], ecx
je 0x415e0f
xor dword [ebp + 0x14], ecx
test dword [ebp + 0x14], edx
je 0x415e17
xor dword [ebp + 0x14], edx
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp - 0x18]
mov eax, edi
shl eax, 2
mov dword [ebp - 0x48], eax
add eax, 4
push eax
call fcn.00413f20
mov edx, eax
test edx, edx
mov dword [ebp - 0x14], edx
jne 0x415e74
push dword [ebp + 8]
call fcn.00417ab1
jmp 0x416586
cmp dword [ebp + 0xc], eax
je 0x415dee
push eax
lea eax, [ebp - 0x1c]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x415e17
push dword [ebp + 8]
call fcn.00417ab1
jmp 0x415d76
mov eax, dword [ebp + 0x14]
and eax, 0x200
mov dword [ebp - 0x10], eax
jne 0x415eb6
test word [ebp + 0x14], 0x100
jne 0x415eb6
lea ecx, [edi + 1]
xor eax, eax
test ecx, ecx
jbe 0x416123
and dword [ebp + 0x1c], eax
cmp eax, edi
mov ecx, dword [ebp + 0x1c]
jb 0x415ea3
mov ecx, dword [ebp + 0xc]
add dword [ebp + 0x1c], ebx
mov dword [edx + eax*4], ecx
inc eax
lea ecx, [edi + 1]
cmp eax, ecx
jb 0x415e99
jmp 0x416123
and dword [ebp - 0x20], 0
test byte [ebp + 0x18], 0xc0
push 8
pop edi
je 0x415f09
push 4
push dword [0x468018]
push dword [ebp + 8]
call fcn.00437ceb
add esp, 0xc
test eax, eax
jne 0x415f02
mov eax, dword [ebp + 8]
push edi
push dword [0x46801c]
add eax, edi
push eax
call fcn.00437ceb
add esp, 0xc
test eax, eax
jne 0x415f02
mov eax, dword [ebp + 8]
cmp byte [eax + 0x14], 1
jne 0x415f02
cmp byte [eax + 0x22], 0x10
je 0x415f09
and dword [ebp + 0x1c], 0
mov dword [ebp + 0x18], edi
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x34], eax
and dword [ebp - 0x34], 0x40
jne 0x415f43
test al, al
js 0x415f43
test al, 9
jne 0x415f3b
cmp dword [ebp - 0x10], 0x200
je 0x415f2e
test word [ebp + 0x14], 0x100
jne 0x415f3b
test al, 2
je 0x415f62
mov dword [ebp - 0x20], 1
jmp 0x415f62
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x20], eax
jmp 0x415f4c
mov eax, dword [ebp + 0x1c]
dec eax
je 0x415f5b
dec eax
je 0x415f52
and dword [ebp + 0x1c], 0
jmp 0x415f62
mov dword [ebp + 0x1c], 3
jmp 0x415f62
mov dword [ebp + 0x1c], 1
mov edi, dword [ebp - 0x30]
push ebx
call fcn.00413f20
test eax, eax
mov dword [ebp - 0xc], eax
jne 0x415f7f
push dword [ebp - 0x14]
call fcn.00417ab1
jmp 0x415e3d
push ebx
call fcn.00413f20
test eax, eax
mov dword [ebp - 8], eax
jne 0x415f96
push dword [ebp - 0xc]
call fcn.00417ab1
jmp 0x415f72
push dword [ebp - 0x2c]
call fcn.00413f20
test eax, eax
mov dword [ebp - 0x2c], eax
jne 0x415faf
push dword [ebp - 8]
call fcn.00417ab1
jmp 0x415f8c
mov eax, dword [ebp - 0x18]
and dword [ebp - 0x24], 0
and dword [ebp - 0x28], 0
test eax, eax
jbe 0x4160e1
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x14]
dec eax
cmp ecx, eax
mov dword [edx + ecx*4], edi
jne 0x415fdd
mov eax, dword [ebp + 0xc]
xor edx, edx
div ebx
test edx, edx
je 0x415fdd
mov ebx, edx
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x24]
push ebx
add eax, ecx
push eax
push dword [ebp - 0xc]
mov dword [ebp - 4], ebx
call fcn.004378f0
add esp, 0xc
cmp dword [ebp - 0x10], 0
je 0x416069
cmp dword [ebp - 0x28], 0
jne 0x41601b
cmp dword [ebp - 0x34], 0
jne 0x416013
test byte [ebp + 0x18], 0x80
je 0x41601b
push 0
push 0
push 8
jmp 0x416050
test byte [ebp + 0x18], 0x34
je 0x416047
call fcn.00413eb4
mov eax, dword [0x46d660]
test eax, eax
je 0x416097
push dword [ebp + 0x1c]
lea ecx, [ebp - 4]
push dword [ebp - 0x20]
push dword [ebp + 0x18]
push ebx
push dword [ebp - 0xc]
push ecx
push dword [ebp - 8]
call eax
jmp 0x416060
push dword [ebp + 0x1c]
push dword [ebp - 0x20]
push dword [ebp + 0x18]
push ebx
push dword [ebp - 0xc]
lea eax, [ebp - 4]
push eax
push dword [ebp - 8]
call fcn.00417380
test eax, eax
jne 0x416097
mov dword [ebp - 4], ebx
jmp 0x416097
test word [ebp + 0x14], 0x100
je 0x416097
push 0
push dword [ebp - 0x20]
lea eax, [ebp - 4]
push 8
push ebx
push dword [ebp - 0xc]
push eax
push dword [ebp - 8]
call fcn.00417380
test eax, eax
jne 0x416091
mov dword [ebp - 4], ebx
jmp 0x41609c
inc dword [ebp - 8]
dec dword [ebp - 4]
cmp dword [ebp - 4], ebx
jb 0x4160b2
mov eax, dword [ebp - 0x2c]
push ebx
push dword [ebp - 0xc]
add eax, edi
push eax
call fcn.004378f0
add esp, 0xc
add edi, ebx
jmp 0x4160c9
push dword [ebp - 4]
mov eax, dword [ebp - 0x2c]
push dword [ebp - 8]
add eax, edi
push eax
call fcn.004378f0
add esp, 0xc
add edi, dword [ebp - 4]
mov eax, dword [ebp - 0x44]
add dword [ebp - 0x24], ebx
inc dword [ebp - 0x28]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x18]
cmp dword [ebp - 0x28], eax
jb 0x415fc2
mov eax, dword [ebp - 0x14]
push dword [ebp - 0x30]
mov ecx, dword [ebp - 0x48]
push eax
push dword [ebp - 0x2c]
mov dword [ebp + 0xc], edi
mov dword [ecx + eax], edi
call fcn.004378f0
add esp, 0xc
push dword [ebp - 8]
call fcn.00417ab1
push dword [ebp - 0xc]
call fcn.00417ab1
push edi
push dword [ebp - 0x2c]
push dword [ebp + 8]
call fcn.004378f0
add esp, 0xc
push dword [ebp - 0x2c]
call fcn.00417ab1
cmp dword [ebp - 0x38], 1
jne 0x416136
mov eax, dword [ebp - 0x3c]
add dword [ebp + 0xc], 0x144
mov dword [ebp + 8], eax
mov eax, dword [ebp - 0x40]
mov eax, dword [eax + 4]
and eax, 0xfffffffe
cmp eax, 0xfffffffe
jne 0x416198
mov eax, dword [esi + 0x13c]
inc eax
shl eax, 4
push eax
call fcn.00413f20
mov edi, eax
test edi, edi
je 0x415e3d
mov eax, dword [esi + 0x11c]
test eax, eax
je 0x41617c
mov ecx, dword [esi + 0x13c]
shl ecx, 4
push ecx
push eax
push edi
call fcn.004378f0
add esp, 0xc
mov eax, dword [esi + 0x11c]
inc dword [esi + 0x13c]
test eax, eax
je 0x416192
push eax
call fcn.00417ab1
mov dword [esi + 0x11c], edi
mov ebx, dword [ebp - 0x40]
mov eax, dword [ebx + 4]
mov edi, dword [esi + 0x13c]
mov ecx, eax
and ecx, 0xfffffffe
dec edi
cmp ecx, 0xfffffffe
jne 0x4161e7
push 1
push dword [ebp + 0x10]
call fcn.00413cca
push 2
push dword [ebp + 0x10]
mov dword [ebx + 8], eax
call fcn.00413cca
mov dword [ebx + 0xc], eax
mov eax, dword [0x46d630]
mov dword [ebx], eax
mov dword [ebx + 4], edi
mov ecx, dword [esi + 0x11c]
mov eax, edi
shl eax, 4
add esp, 0x10
and dword [eax + ecx], 0
jmp 0x4161e9
mov edi, eax
mov eax, dword [esi + 0x11c]
mov edx, dword [ebp + 0xc]
shl edi, 4
add eax, edi
cmp dword [eax], 0
je 0x416201
cmp dword [eax + 8], edx
jae 0x416225
mov ebx, dword [eax]
add ebx, dword [eax + 8]
mov ecx, dword [esi + 0x12c]
cmp ebx, ecx
jne 0x41621d
sub ecx, dword [eax + 8]
add ecx, edx
mov dword [esi + 0x12c], ecx
jmp 0x416225
mov dword [eax], ecx
add dword [esi + 0x12c], edx
mov eax, dword [esi + 0x11c]
mov ecx, dword [ebp + 0xc]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [edi + eax + 8], ecx
mov eax, dword [esi + 0x11c]
mov ecx, dword [ebp - 0x4c]
mov dword [edi + eax + 0xc], ecx
mov eax, dword [ebp + 0x14]
mov ecx, dword [esi + 0x11c]
push 0
or eax, 0x80000000
mov dword [edi + ecx + 4], eax
mov eax, dword [esi + 0x11c]
mov eax, dword [edi + eax]
push 0
push dword [esi + 0x15c]
mov dword [ebp - 0x4c], eax
push dword [esi + 0x120]
call ebx
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [esi + 0x128]
lea eax, [esi + 0x124]
push eax
push dword [esi + 0x120]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test dword [ebp + 0x14], 0x10000
je 0x416347
push 3
push dword [ebp + 0x10]
call fcn.00413cca
test dword [ebp + 0x14], 0x20000
pop ecx
pop ecx
mov dword [ebp + 0x1c], eax
je 0x4162cc
mov eax, dword [esi + 0x11c]
add eax, edi
mov ecx, dword [eax]
add ecx, dword [ebp + 0x1c]
xor ecx, dword [eax + 0xc]
mov dword [ebp + 0x1c], ecx
mov cl, byte [esi + 0x142]
mov eax, 0x200
shl eax, cl
xor edx, edx
mov dword [ebp + 0x18], eax
mov eax, dword [esi + 0x11c]
mov eax, dword [edi + eax + 0xc]
div dword [ebp + 0x18]
test edx, edx
mov dword [ebp + 0x18], eax
je 0x4162f5
inc dword [ebp + 0x18]
cmp dword [ebp - 0x10], 0x200
je 0x416306
test word [ebp + 0x14], 0x100
je 0x416319
mov eax, dword [ebp + 0x1c]
dec eax
push eax
push dword [ebp - 0x30]
push dword [ebp + 8]
call fcn.00413d53
add esp, 0xc
xor edi, edi
cmp dword [ebp + 0x18], edi
jbe 0x416347
mov ecx, dword [ebp - 0x14]
mov eax, dword [ecx + edi*4]
mov ecx, dword [ecx + edi*4 + 4]
push dword [ebp + 0x1c]
sub ecx, eax
push ecx
mov ecx, dword [ebp + 8]
add eax, ecx
push eax
call fcn.00413d53
add esp, 0xc
inc dword [ebp + 0x1c]
inc edi
cmp edi, dword [ebp + 0x18]
jb 0x416320
push dword [ebp - 0x14]
call fcn.00417ab1
mov eax, dword [esi + 0x15c]
add eax, dword [ebp - 0x4c]
xor edi, edi
push edi
push edi
push eax
push dword [esi + 0x120]
call ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [ebp - 0x1c]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [esi + 0x120]
call edi
push dword [ebp + 8]
call fcn.00417ab1
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
call fcn.00413f20
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x13c]
je 0x41640d
shl eax, 4
push eax
push dword [esi + 0x11c]
push dword [ebp + 8]
call fcn.004378f0
push dword [0x46d524]
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413d53
mov eax, dword [esi + 0x134]
add eax, dword [esi + 0x15c]
add esp, 0x18
push 0
push 0
push eax
push dword [esi + 0x120]
call ebx
push 0
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [ebp + 8]
push dword [esi + 0x120]
call edi
push dword [ebp + 8]
call fcn.00417ab1
jmp 0x41647a
push dword [0x46d524]
shl eax, 4
push eax
push dword [esi + 0x11c]
call fcn.00413d53
mov eax, dword [esi + 0x134]
add eax, dword [esi + 0x15c]
add esp, 0xc
push 0
push 0
push eax
push dword [esi + 0x120]
call ebx
push 0
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [esi + 0x11c]
push dword [esi + 0x120]
call edi
push dword [0x46d524]
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [esi + 0x11c]
call fcn.00413db6
add esp, 0xc
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
call fcn.00413f20
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x138]
je 0x416501
shl eax, 4
push eax
push dword [esi + 0x118]
push dword [ebp + 8]
call fcn.004378f0
push dword [0x46d520]
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413d53
mov eax, dword [esi + 0x130]
add eax, dword [esi + 0x15c]
add esp, 0x18
push 0
push 0
push eax
push dword [esi + 0x120]
call ebx
push 0
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [ebp + 8]
push dword [esi + 0x120]
call edi
push dword [ebp + 8]
call fcn.00417ab1
jmp 0x41656e
push dword [0x46d520]
shl eax, 4
push eax
push dword [esi + 0x118]
call fcn.00413d53
mov eax, dword [esi + 0x130]
add eax, dword [esi + 0x15c]
add esp, 0xc
push 0
push 0
push eax
push dword [esi + 0x120]
call ebx
push 0
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [esi + 0x118]
push dword [esi + 0x120]
call edi
push dword [0x46d520]
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [esi + 0x118]
call fcn.00413db6
add esp, 0xc
push dword [ebp + 0x10]
push esi
call fcn.004156ce
pop ecx
xor eax, eax
pop ecx
inc eax
jmp 0x416588
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x18