Function at 0x415b78
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 0x4164a7
mov ebx, dword [ebp + 0xc]
cmp ebx, edi
je 0x4164a7
mov ecx, dword [ebp + 0x10]
cmp ecx, edi
je 0x4164a7
cmp byte [ebx], 0
je 0x4164a7
cmp byte [ecx], 0
je 0x4164a7
test word [esi + 0x16c], 0x8000
jne 0x415bc8
push 5
jmp 0x4164a9
xor eax, eax
test byte [ebp + 0x14], 1
je 0x415bd4
inc eax
xor dword [ebp + 0x14], eax
push eax
push dword [0x46d630]
push ecx
push esi
call fcn.0041502d
add esp, 0x10
cmp eax, edi
mov dword [ebp - 0x40], eax
je 0x4164af
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 0x4164af
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 0x415c3b
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 0x415c55
test ax, 0x100
je 0x415c62
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.00437c6b
add esp, 0xc
test eax, eax
mov eax, dword [ebp + 0xc]
jne 0x415cf3
add edi, eax
mov dword [ebp - 0x2c], edi
add edi, 0x144
push edi
mov dword [ebp - 0x38], 1
call fcn.00417a63
test eax, eax
mov dword [ebp - 0x3c], eax
jne 0x415cad
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4164af
mov edi, dword [ebp - 0x3c]
push dword [ebp + 0x10]
mov byte [edi], 0x44
mov byte [edi + 1], 1
call fcn.00437be0
pop ecx
mov ecx, 0x104
cmp eax, ecx
ja 0x415cd8
push eax
push dword [ebp + 0x10]
lea eax, [edi + 0x40]
push eax
call fcn.00437870
jmp 0x415ce5
push ecx
push dword [ebp + 0x10]
lea eax, [edi + 0x40]
push eax
call fcn.00439500
add esp, 0xc
add edi, 0x144
mov dword [ebp + 8], edi
jmp 0x415d01
add eax, edi
push eax
mov dword [ebp - 0x2c], eax
call fcn.00417a63
mov dword [ebp + 8], eax
xor eax, eax
cmp dword [ebp + 8], eax
mov ecx, 0x10000
mov edx, 0x20000
jne 0x415d73
cmp dword [ebp + 0xc], eax
jne 0x415c9f
cmp dword [ebp - 0x10], eax
je 0x415d23
xor dword [ebp + 0x14], 0x200
mov eax, pe_nt_image_headers32
test dword [ebp + 0x14], eax
je 0x415d30
xor dword [ebp + 0x14], eax
test dword [ebp + 0x14], ecx
je 0x415d38
xor dword [ebp + 0x14], ecx
test dword [ebp + 0x14], edx
je 0x415d40
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.00417a63
mov edx, eax
test edx, edx
mov dword [ebp - 0x14], edx
jne 0x415d9d
push dword [ebp + 8]
call fcn.004179da
jmp 0x4164af
cmp dword [ebp + 0xc], eax
je 0x415d17
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 0x415d40
push dword [ebp + 8]
call fcn.004179da
jmp 0x415c9f
mov eax, dword [ebp + 0x14]
and eax, 0x200
mov dword [ebp - 0x10], eax
jne 0x415ddf
test word [ebp + 0x14], 0x100
jne 0x415ddf
lea ecx, [edi + 1]
xor eax, eax
test ecx, ecx
jbe 0x41604c
and dword [ebp + 0x1c], eax
cmp eax, edi
mov ecx, dword [ebp + 0x1c]
jb 0x415dcc
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 0x415dc2
jmp 0x41604c
and dword [ebp - 0x20], 0
test byte [ebp + 0x18], 0xc0
push 8
pop edi
je 0x415e32
push 4
push dword [0x468018]
push dword [ebp + 8]
call fcn.00437c6b
add esp, 0xc
test eax, eax
jne 0x415e2b
mov eax, dword [ebp + 8]
push edi
push dword [0x46801c]
add eax, edi
push eax
call fcn.00437c6b
add esp, 0xc
test eax, eax
jne 0x415e2b
mov eax, dword [ebp + 8]
cmp byte [eax + 0x14], 1
jne 0x415e2b
cmp byte [eax + 0x22], 0x10
je 0x415e32
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 0x415e6c
test al, al
js 0x415e6c
test al, 9
jne 0x415e64
cmp dword [ebp - 0x10], 0x200
je 0x415e57
test word [ebp + 0x14], 0x100
jne 0x415e64
test al, 2
je 0x415e8b
mov dword [ebp - 0x20], 1
jmp 0x415e8b
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x20], eax
jmp 0x415e75
mov eax, dword [ebp + 0x1c]
dec eax
je 0x415e84
dec eax
je 0x415e7b
and dword [ebp + 0x1c], 0
jmp 0x415e8b
mov dword [ebp + 0x1c], 3
jmp 0x415e8b
mov dword [ebp + 0x1c], 1
mov edi, dword [ebp - 0x30]
push ebx
call fcn.00417a63
test eax, eax
mov dword [ebp - 0xc], eax
jne 0x415ea8
push dword [ebp - 0x14]
call fcn.004179da
jmp 0x415d66
push ebx
call fcn.00417a63
test eax, eax
mov dword [ebp - 8], eax
jne 0x415ebf
push dword [ebp - 0xc]
call fcn.004179da
jmp 0x415e9b
push dword [ebp - 0x2c]
call fcn.00417a63
test eax, eax
mov dword [ebp - 0x2c], eax
jne 0x415ed8
push dword [ebp - 8]
call fcn.004179da
jmp 0x415eb5
mov eax, dword [ebp - 0x18]
and dword [ebp - 0x24], 0
and dword [ebp - 0x28], 0
test eax, eax
jbe 0x41600a
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x14]
dec eax
cmp ecx, eax
mov dword [edx + ecx*4], edi
jne 0x415f06
mov eax, dword [ebp + 0xc]
xor edx, edx
div ebx
test edx, edx
je 0x415f06
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.00437870
add esp, 0xc
cmp dword [ebp - 0x10], 0
je 0x415f92
cmp dword [ebp - 0x28], 0
jne 0x415f44
cmp dword [ebp - 0x34], 0
jne 0x415f3c
test byte [ebp + 0x18], 0x80
je 0x415f44
push 0
push 0
push 8
jmp 0x415f79
test byte [ebp + 0x18], 0x34
je 0x415f70
call fcn.00413dfe
mov eax, dword [0x46d660]
test eax, eax
je 0x415fc0
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 0x415f89
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.004172a9
test eax, eax
jne 0x415fc0
mov dword [ebp - 4], ebx
jmp 0x415fc0
test word [ebp + 0x14], 0x100
je 0x415fc0
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.004172a9
test eax, eax
jne 0x415fba
mov dword [ebp - 4], ebx
jmp 0x415fc5
inc dword [ebp - 8]
dec dword [ebp - 4]
cmp dword [ebp - 4], ebx
jb 0x415fdb
mov eax, dword [ebp - 0x2c]
push ebx
push dword [ebp - 0xc]
add eax, edi
push eax
call fcn.00437870
add esp, 0xc
add edi, ebx
jmp 0x415ff2
push dword [ebp - 4]
mov eax, dword [ebp - 0x2c]
push dword [ebp - 8]
add eax, edi
push eax
call fcn.00437870
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 0x415eeb
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.00437870
add esp, 0xc
push dword [ebp - 8]
call fcn.004179da
push dword [ebp - 0xc]
call fcn.004179da
push edi
push dword [ebp - 0x2c]
push dword [ebp + 8]
call fcn.00437870
add esp, 0xc
push dword [ebp - 0x2c]
call fcn.004179da
cmp dword [ebp - 0x38], 1
jne 0x41605f
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 0x4160c1
mov eax, dword [esi + 0x13c]
inc eax
shl eax, 4
push eax
call fcn.00417a63
mov edi, eax
test edi, edi
je 0x415d66
mov eax, dword [esi + 0x11c]
test eax, eax
je 0x4160a5
mov ecx, dword [esi + 0x13c]
shl ecx, 4
push ecx
push eax
push edi
call fcn.00437870
add esp, 0xc
mov eax, dword [esi + 0x11c]
inc dword [esi + 0x13c]
test eax, eax
je 0x4160bb
push eax
call fcn.004179da
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 0x416110
push 1
push dword [ebp + 0x10]
call fcn.00413c14
push 2
push dword [ebp + 0x10]
mov dword [ebx + 8], eax
call fcn.00413c14
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 0x416112
mov edi, eax
mov eax, dword [esi + 0x11c]
mov edx, dword [ebp + 0xc]
shl edi, 4
add eax, edi
cmp dword [eax], 0
je 0x41612a
cmp dword [eax + 8], edx
jae 0x41614e
mov ebx, dword [eax]
add ebx, dword [eax + 8]
mov ecx, dword [esi + 0x12c]
cmp ebx, ecx
jne 0x416146
sub ecx, dword [eax + 8]
add ecx, edx
mov dword [esi + 0x12c], ecx
jmp 0x41614e
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 0x416270
push 3
push dword [ebp + 0x10]
call fcn.00413c14
test dword [ebp + 0x14], 0x20000
pop ecx
pop ecx
mov dword [ebp + 0x1c], eax
je 0x4161f5
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 0x41621e
inc dword [ebp + 0x18]
cmp dword [ebp - 0x10], 0x200
je 0x41622f
test word [ebp + 0x14], 0x100
je 0x416242
mov eax, dword [ebp + 0x1c]
dec eax
push eax
push dword [ebp - 0x30]
push dword [ebp + 8]
call fcn.00413c9d
add esp, 0xc
xor edi, edi
cmp dword [ebp + 0x18], edi
jbe 0x416270
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.00413c9d
add esp, 0xc
inc dword [ebp + 0x1c]
inc edi
cmp edi, dword [ebp + 0x18]
jb 0x416249
push dword [ebp - 0x14]
call fcn.004179da
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.004179da
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
call fcn.00417a63
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x13c]
je 0x416336
shl eax, 4
push eax
push dword [esi + 0x11c]
push dword [ebp + 8]
call fcn.00437870
push dword [0x46d524]
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413c9d
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.004179da
jmp 0x4163a3
push dword [0x46d524]
shl eax, 4
push eax
push dword [esi + 0x11c]
call fcn.00413c9d
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.00413d00
add esp, 0xc
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
call fcn.00417a63
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x138]
je 0x41642a
shl eax, 4
push eax
push dword [esi + 0x118]
push dword [ebp + 8]
call fcn.00437870
push dword [0x46d520]
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413c9d
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.004179da
jmp 0x416497
push dword [0x46d520]
shl eax, 4
push eax
push dword [esi + 0x118]
call fcn.00413c9d
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.00413d00
add esp, 0xc
push dword [ebp + 0x10]
push esi
call fcn.004155f7
pop ecx
xor eax, eax
pop ecx
inc eax
jmp 0x4164b1
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x18