Function at 0x415c7c
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 0x4165ab
mov ebx, dword [ebp + 0xc]
cmp ebx, edi
je 0x4165ab
mov ecx, dword [ebp + 0x10]
cmp ecx, edi
je 0x4165ab
cmp byte [ebx], 0
je 0x4165ab
cmp byte [ecx], 0
je 0x4165ab
test word [esi + 0x16c], 0x8000
jne 0x415ccc
push 5
jmp 0x4165ad
xor eax, eax
test byte [ebp + 0x14], 1
je 0x415cd8
inc eax
xor dword [ebp + 0x14], eax
push eax
push dword [0x46d630]
push ecx
push esi
call fcn.00415131
add esp, 0x10
cmp eax, edi
mov dword [ebp - 0x40], eax
je 0x4165b3
push edi
push edi
push 3
push edi
push 1
push 0x80000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
je 0x4165b3
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 0x415d3f
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 0x415d59
test ax, 0x100
je 0x415d66
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.00437d5b
add esp, 0xc
test eax, eax
mov eax, dword [ebp + 0xc]
jne 0x415df7
add edi, eax
mov dword [ebp - 0x2c], edi
add edi, 0x144
push edi
mov dword [ebp - 0x38], 1
call fcn.00417b53
test eax, eax
mov dword [ebp - 0x3c], eax
jne 0x415db1
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4165b3
mov edi, dword [ebp - 0x3c]
push dword [ebp + 0x10]
mov byte [edi], 0x44
mov byte [edi + 1], 1
call fcn.00437cd0
pop ecx
mov ecx, 0x104
cmp eax, ecx
ja 0x415ddc
push eax
push dword [ebp + 0x10]
lea eax, [edi + 0x40]
push eax
call fcn.00437960
jmp 0x415de9
push ecx
push dword [ebp + 0x10]
lea eax, [edi + 0x40]
push eax
call fcn.004395f0
add esp, 0xc
add edi, 0x144
mov dword [ebp + 8], edi
jmp 0x415e05
add eax, edi
push eax
mov dword [ebp - 0x2c], eax
call fcn.00417b53
mov dword [ebp + 8], eax
xor eax, eax
cmp dword [ebp + 8], eax
mov ecx, 0x10000
mov edx, 0x20000
jne 0x415e77
cmp dword [ebp + 0xc], eax
jne 0x415da3
cmp dword [ebp - 0x10], eax
je 0x415e27
xor dword [ebp + 0x14], 0x200
mov eax, pe_nt_image_headers32
test dword [ebp + 0x14], eax
je 0x415e34
xor dword [ebp + 0x14], eax
test dword [ebp + 0x14], ecx
je 0x415e3c
xor dword [ebp + 0x14], ecx
test dword [ebp + 0x14], edx
je 0x415e44
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.00417b53
mov edx, eax
test edx, edx
mov dword [ebp - 0x14], edx
jne 0x415ea1
push dword [ebp + 8]
call fcn.00413886
jmp 0x4165b3
cmp dword [ebp + 0xc], eax
je 0x415e1b
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 0x415e44
push dword [ebp + 8]
call fcn.00413886
jmp 0x415da3
mov eax, dword [ebp + 0x14]
and eax, 0x200
mov dword [ebp - 0x10], eax
jne 0x415ee3
test word [ebp + 0x14], 0x100
jne 0x415ee3
lea ecx, [edi + 1]
xor eax, eax
test ecx, ecx
jbe 0x416150
and dword [ebp + 0x1c], eax
cmp eax, edi
mov ecx, dword [ebp + 0x1c]
jb 0x415ed0
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 0x415ec6
jmp 0x416150
and dword [ebp - 0x20], 0
test byte [ebp + 0x18], 0xc0
push 8
pop edi
je 0x415f36
push 4
push dword [0x468018]
push dword [ebp + 8]
call fcn.00437d5b
add esp, 0xc
test eax, eax
jne 0x415f2f
mov eax, dword [ebp + 8]
push edi
push dword [0x46801c]
add eax, edi
push eax
call fcn.00437d5b
add esp, 0xc
test eax, eax
jne 0x415f2f
mov eax, dword [ebp + 8]
cmp byte [eax + 0x14], 1
jne 0x415f2f
cmp byte [eax + 0x22], 0x10
je 0x415f36
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 0x415f70
test al, al
js 0x415f70
test al, 9
jne 0x415f68
cmp dword [ebp - 0x10], 0x200
je 0x415f5b
test word [ebp + 0x14], 0x100
jne 0x415f68
test al, 2
je 0x415f8f
mov dword [ebp - 0x20], 1
jmp 0x415f8f
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x20], eax
jmp 0x415f79
mov eax, dword [ebp + 0x1c]
dec eax
je 0x415f88
dec eax
je 0x415f7f
and dword [ebp + 0x1c], 0
jmp 0x415f8f
mov dword [ebp + 0x1c], 3
jmp 0x415f8f
mov dword [ebp + 0x1c], 1
mov edi, dword [ebp - 0x30]
push ebx
call fcn.00417b53
test eax, eax
mov dword [ebp - 0xc], eax
jne 0x415fac
push dword [ebp - 0x14]
call fcn.00413886
jmp 0x415e6a
push ebx
call fcn.00417b53
test eax, eax
mov dword [ebp - 8], eax
jne 0x415fc3
push dword [ebp - 0xc]
call fcn.00413886
jmp 0x415f9f
push dword [ebp - 0x2c]
call fcn.00417b53
test eax, eax
mov dword [ebp - 0x2c], eax
jne 0x415fdc
push dword [ebp - 8]
call fcn.00413886
jmp 0x415fb9
mov eax, dword [ebp - 0x18]
and dword [ebp - 0x24], 0
and dword [ebp - 0x28], 0
test eax, eax
jbe 0x41610e
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x14]
dec eax
cmp ecx, eax
mov dword [edx + ecx*4], edi
jne 0x41600a
mov eax, dword [ebp + 0xc]
xor edx, edx
div ebx
test edx, edx
je 0x41600a
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.00437960
add esp, 0xc
cmp dword [ebp - 0x10], 0
je 0x416096
cmp dword [ebp - 0x28], 0
jne 0x416048
cmp dword [ebp - 0x34], 0
jne 0x416040
test byte [ebp + 0x18], 0x80
je 0x416048
push 0
push 0
push 8
jmp 0x41607d
test byte [ebp + 0x18], 0x34
je 0x416074
call fcn.00413f02
mov eax, dword [0x46d660]
test eax, eax
je 0x4160c4
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 0x41608d
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.004173ad
test eax, eax
jne 0x4160c4
mov dword [ebp - 4], ebx
jmp 0x4160c4
test word [ebp + 0x14], 0x100
je 0x4160c4
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.004173ad
test eax, eax
jne 0x4160be
mov dword [ebp - 4], ebx
jmp 0x4160c9
inc dword [ebp - 8]
dec dword [ebp - 4]
cmp dword [ebp - 4], ebx
jb 0x4160df
mov eax, dword [ebp - 0x2c]
push ebx
push dword [ebp - 0xc]
add eax, edi
push eax
call fcn.00437960
add esp, 0xc
add edi, ebx
jmp 0x4160f6
push dword [ebp - 4]
mov eax, dword [ebp - 0x2c]
push dword [ebp - 8]
add eax, edi
push eax
call fcn.00437960
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 0x415fef
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.00437960
add esp, 0xc
push dword [ebp - 8]
call fcn.00413886
push dword [ebp - 0xc]
call fcn.00413886
push edi
push dword [ebp - 0x2c]
push dword [ebp + 8]
call fcn.00437960
add esp, 0xc
push dword [ebp - 0x2c]
call fcn.00413886
cmp dword [ebp - 0x38], 1
jne 0x416163
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 0x4161c5
mov eax, dword [esi + 0x13c]
inc eax
shl eax, 4
push eax
call fcn.00417b53
mov edi, eax
test edi, edi
je 0x415e6a
mov eax, dword [esi + 0x11c]
test eax, eax
je 0x4161a9
mov ecx, dword [esi + 0x13c]
shl ecx, 4
push ecx
push eax
push edi
call fcn.00437960
add esp, 0xc
mov eax, dword [esi + 0x11c]
inc dword [esi + 0x13c]
test eax, eax
je 0x4161bf
push eax
call fcn.00413886
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 0x416214
push 1
push dword [ebp + 0x10]
call fcn.00413d18
push 2
push dword [ebp + 0x10]
mov dword [ebx + 8], eax
call fcn.00413d18
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 0x416216
mov edi, eax
mov eax, dword [esi + 0x11c]
mov edx, dword [ebp + 0xc]
shl edi, 4
add eax, edi
cmp dword [eax], 0
je 0x41622e
cmp dword [eax + 8], edx
jae 0x416252
mov ebx, dword [eax]
add ebx, dword [eax + 8]
mov ecx, dword [esi + 0x12c]
cmp ebx, ecx
jne 0x41624a
sub ecx, dword [eax + 8]
add ecx, edx
mov dword [esi + 0x12c], ecx
jmp 0x416252
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 0x416374
push 3
push dword [ebp + 0x10]
call fcn.00413d18
test dword [ebp + 0x14], 0x20000
pop ecx
pop ecx
mov dword [ebp + 0x1c], eax
je 0x4162f9
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 0x416322
inc dword [ebp + 0x18]
cmp dword [ebp - 0x10], 0x200
je 0x416333
test word [ebp + 0x14], 0x100
je 0x416346
mov eax, dword [ebp + 0x1c]
dec eax
push eax
push dword [ebp - 0x30]
push dword [ebp + 8]
call fcn.00413da1
add esp, 0xc
xor edi, edi
cmp dword [ebp + 0x18], edi
jbe 0x416374
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.00413da1
add esp, 0xc
inc dword [ebp + 0x1c]
inc edi
cmp edi, dword [ebp + 0x18]
jb 0x41634d
push dword [ebp - 0x14]
call fcn.00413886
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.00413886
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
call fcn.00417b53
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x13c]
je 0x41643a
shl eax, 4
push eax
push dword [esi + 0x11c]
push dword [ebp + 8]
call fcn.00437960
push dword [0x46d524]
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413da1
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.00413886
jmp 0x4164a7
push dword [0x46d524]
shl eax, 4
push eax
push dword [esi + 0x11c]
call fcn.00413da1
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.00413e04
add esp, 0xc
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
call fcn.00417b53
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x138]
je 0x41652e
shl eax, 4
push eax
push dword [esi + 0x118]
push dword [ebp + 8]
call fcn.00437960
push dword [0x46d520]
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413da1
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.00413886
jmp 0x41659b
push dword [0x46d520]
shl eax, 4
push eax
push dword [esi + 0x118]
call fcn.00413da1
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.00413e04
add esp, 0xc
push dword [ebp + 0x10]
push esi
call fcn.004156fb
pop ecx
xor eax, eax
pop ecx
inc eax
jmp 0x4165b5
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x18