Function at 0x415b0d
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 0x41643c
mov ebx, dword [ebp + 0xc]
cmp ebx, edi
je 0x41643c
mov ecx, dword [ebp + 0x10]
cmp ecx, edi
je 0x41643c
cmp byte [ebx], 0
je 0x41643c
cmp byte [ecx], 0
je 0x41643c
test word [esi + 0x16c], 0x8000
jne 0x415b5d
push 5
jmp 0x41643e
xor eax, eax
test byte [ebp + 0x14], 1
je 0x415b69
inc eax
xor dword [ebp + 0x14], eax
push eax
push dword [0x46d630]
push ecx
push esi
call fcn.00414fc2
add esp, 0x10
cmp eax, edi
mov dword [ebp - 0x40], eax
je 0x416444
push edi
push edi
push 3
push edi
push 1
push SysReAllocString
push ebx
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
je 0x416444
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 0x415bd0
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 0x415bea
test ax, 0x100
je 0x415bf7
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.00437bcb
add esp, 0xc
test eax, eax
mov eax, dword [ebp + 0xc]
jne 0x415c88
add edi, eax
mov dword [ebp - 0x2c], edi
add edi, 0x144
push edi
mov dword [ebp - 0x38], 1
call fcn.00413dde
test eax, eax
mov dword [ebp - 0x3c], eax
jne 0x415c42
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
jmp 0x416444
mov edi, dword [ebp - 0x3c]
push dword [ebp + 0x10]
mov byte [edi], 0x44
mov byte [edi + 1], 1
call fcn.00437b40
pop ecx
mov ecx, 0x104
cmp eax, ecx
ja 0x415c6d
push eax
push dword [ebp + 0x10]
lea eax, [edi + 0x40]
push eax
call fcn.004377d0
jmp 0x415c7a
push ecx
push dword [ebp + 0x10]
lea eax, [edi + 0x40]
push eax
call fcn.00439460
add esp, 0xc
add edi, 0x144
mov dword [ebp + 8], edi
jmp 0x415c96
add eax, edi
push eax
mov dword [ebp - 0x2c], eax
call fcn.00413dde
mov dword [ebp + 8], eax
xor eax, eax
cmp dword [ebp + 8], eax
mov ecx, 0x10000
mov edx, 0x20000
jne 0x415d08
cmp dword [ebp + 0xc], eax
jne 0x415c34
cmp dword [ebp - 0x10], eax
je 0x415cb8
xor dword [ebp + 0x14], 0x200
mov eax, pe_nt_image_headers32
test dword [ebp + 0x14], eax
je 0x415cc5
xor dword [ebp + 0x14], eax
test dword [ebp + 0x14], ecx
je 0x415ccd
xor dword [ebp + 0x14], ecx
test dword [ebp + 0x14], edx
je 0x415cd5
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.00413dde
mov edx, eax
test edx, edx
mov dword [ebp - 0x14], edx
jne 0x415d32
push dword [ebp + 8]
call fcn.004136f6
jmp 0x416444
cmp dword [ebp + 0xc], eax
je 0x415cac
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 0x415cd5
push dword [ebp + 8]
call fcn.004136f6
jmp 0x415c34
mov eax, dword [ebp + 0x14]
and eax, 0x200
mov dword [ebp - 0x10], eax
jne 0x415d74
test word [ebp + 0x14], 0x100
jne 0x415d74
lea ecx, [edi + 1]
xor eax, eax
test ecx, ecx
jbe 0x415fe1
and dword [ebp + 0x1c], eax
cmp eax, edi
mov ecx, dword [ebp + 0x1c]
jb 0x415d61
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 0x415d57
jmp 0x415fe1
and dword [ebp - 0x20], 0
test byte [ebp + 0x18], 0xc0
push 8
pop edi
je 0x415dc7
push 4
push dword [0x468018]
push dword [ebp + 8]
call fcn.00437bcb
add esp, 0xc
test eax, eax
jne 0x415dc0
mov eax, dword [ebp + 8]
push edi
push dword [0x46801c]
add eax, edi
push eax
call fcn.00437bcb
add esp, 0xc
test eax, eax
jne 0x415dc0
mov eax, dword [ebp + 8]
cmp byte [eax + 0x14], 1
jne 0x415dc0
cmp byte [eax + 0x22], 0x10
je 0x415dc7
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 0x415e01
test al, al
js 0x415e01
test al, 9
jne 0x415df9
cmp dword [ebp - 0x10], 0x200
je 0x415dec
test word [ebp + 0x14], 0x100
jne 0x415df9
test al, 2
je 0x415e20
mov dword [ebp - 0x20], 1
jmp 0x415e20
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x20], eax
jmp 0x415e0a
mov eax, dword [ebp + 0x1c]
dec eax
je 0x415e19
dec eax
je 0x415e10
and dword [ebp + 0x1c], 0
jmp 0x415e20
mov dword [ebp + 0x1c], 3
jmp 0x415e20
mov dword [ebp + 0x1c], 1
mov edi, dword [ebp - 0x30]
push ebx
call fcn.00413dde
test eax, eax
mov dword [ebp - 0xc], eax
jne 0x415e3d
push dword [ebp - 0x14]
call fcn.004136f6
jmp 0x415cfb
push ebx
call fcn.00413dde
test eax, eax
mov dword [ebp - 8], eax
jne 0x415e54
push dword [ebp - 0xc]
call fcn.004136f6
jmp 0x415e30
push dword [ebp - 0x2c]
call fcn.00413dde
test eax, eax
mov dword [ebp - 0x2c], eax
jne 0x415e6d
push dword [ebp - 8]
call fcn.004136f6
jmp 0x415e4a
mov eax, dword [ebp - 0x18]
and dword [ebp - 0x24], 0
and dword [ebp - 0x28], 0
test eax, eax
jbe 0x415f9f
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x14]
dec eax
cmp ecx, eax
mov dword [edx + ecx*4], edi
jne 0x415e9b
mov eax, dword [ebp + 0xc]
xor edx, edx
div ebx
test edx, edx
je 0x415e9b
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.004377d0
add esp, 0xc
cmp dword [ebp - 0x10], 0
je 0x415f27
cmp dword [ebp - 0x28], 0
jne 0x415ed9
cmp dword [ebp - 0x34], 0
jne 0x415ed1
test byte [ebp + 0x18], 0x80
je 0x415ed9
push 0
push 0
push 8
jmp 0x415f0e
test byte [ebp + 0x18], 0x34
je 0x415f05
call fcn.00413d72
mov eax, dword [0x46d660]
test eax, eax
je 0x415f55
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 0x415f1e
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.0041723e
test eax, eax
jne 0x415f55
mov dword [ebp - 4], ebx
jmp 0x415f55
test word [ebp + 0x14], 0x100
je 0x415f55
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.0041723e
test eax, eax
jne 0x415f4f
mov dword [ebp - 4], ebx
jmp 0x415f5a
inc dword [ebp - 8]
dec dword [ebp - 4]
cmp dword [ebp - 4], ebx
jb 0x415f70
mov eax, dword [ebp - 0x2c]
push ebx
push dword [ebp - 0xc]
add eax, edi
push eax
call fcn.004377d0
add esp, 0xc
add edi, ebx
jmp 0x415f87
push dword [ebp - 4]
mov eax, dword [ebp - 0x2c]
push dword [ebp - 8]
add eax, edi
push eax
call fcn.004377d0
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 0x415e80
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.004377d0
add esp, 0xc
push dword [ebp - 8]
call fcn.004136f6
push dword [ebp - 0xc]
call fcn.004136f6
push edi
push dword [ebp - 0x2c]
push dword [ebp + 8]
call fcn.004377d0
add esp, 0xc
push dword [ebp - 0x2c]
call fcn.004136f6
cmp dword [ebp - 0x38], 1
jne 0x415ff4
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 0x416056
mov eax, dword [esi + 0x13c]
inc eax
shl eax, 4
push eax
call fcn.00413dde
mov edi, eax
test edi, edi
je 0x415cfb
mov eax, dword [esi + 0x11c]
test eax, eax
je 0x41603a
mov ecx, dword [esi + 0x13c]
shl ecx, 4
push ecx
push eax
push edi
call fcn.004377d0
add esp, 0xc
mov eax, dword [esi + 0x11c]
inc dword [esi + 0x13c]
test eax, eax
je 0x416050
push eax
call fcn.004136f6
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 0x4160a5
push 1
push dword [ebp + 0x10]
call fcn.00413b88
push 2
push dword [ebp + 0x10]
mov dword [ebx + 8], eax
call fcn.00413b88
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 0x4160a7
mov edi, eax
mov eax, dword [esi + 0x11c]
mov edx, dword [ebp + 0xc]
shl edi, 4
add eax, edi
cmp dword [eax], 0
je 0x4160bf
cmp dword [eax + 8], edx
jae 0x4160e3
mov ebx, dword [eax]
add ebx, dword [eax + 8]
mov ecx, dword [esi + 0x12c]
cmp ebx, ecx
jne 0x4160db
sub ecx, dword [eax + 8]
add ecx, edx
mov dword [esi + 0x12c], ecx
jmp 0x4160e3
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 0x416205
push 3
push dword [ebp + 0x10]
call fcn.00413b88
test dword [ebp + 0x14], 0x20000
pop ecx
pop ecx
mov dword [ebp + 0x1c], eax
je 0x41618a
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 0x4161b3
inc dword [ebp + 0x18]
cmp dword [ebp - 0x10], 0x200
je 0x4161c4
test word [ebp + 0x14], 0x100
je 0x4161d7
mov eax, dword [ebp + 0x1c]
dec eax
push eax
push dword [ebp - 0x30]
push dword [ebp + 8]
call fcn.00413c11
add esp, 0xc
xor edi, edi
cmp dword [ebp + 0x18], edi
jbe 0x416205
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.00413c11
add esp, 0xc
inc dword [ebp + 0x1c]
inc edi
cmp edi, dword [ebp + 0x18]
jb 0x4161de
push dword [ebp - 0x14]
call fcn.004136f6
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.004136f6
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
call fcn.00413dde
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x13c]
je 0x4162cb
shl eax, 4
push eax
push dword [esi + 0x11c]
push dword [ebp + 8]
call fcn.004377d0
push dword [0x46d524]
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413c11
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.004136f6
jmp 0x416338
push dword [0x46d524]
shl eax, 4
push eax
push dword [esi + 0x11c]
call fcn.00413c11
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.00413c74
add esp, 0xc
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
call fcn.00413dde
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x138]
je 0x4163bf
shl eax, 4
push eax
push dword [esi + 0x118]
push dword [ebp + 8]
call fcn.004377d0
push dword [0x46d520]
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413c11
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.004136f6
jmp 0x41642c
push dword [0x46d520]
shl eax, 4
push eax
push dword [esi + 0x118]
call fcn.00413c11
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.00413c74
add esp, 0xc
push dword [ebp + 0x10]
push esi
call fcn.0041558c
pop ecx
xor eax, eax
pop ecx
inc eax
jmp 0x416446
push 0x57
call dword [sym.imp.KERNEL32.DLL_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x18