Function at 0x40d243
Capabilities:
Check if file exists
Read file on windows
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34
push ebx
push esi
mov esi, ecx
push edi
push dword [ebp + 8]
mov dword [esp + 0x18], esi
lea ebx, [esi + 0x78]
mov ecx, ebx
mov dword [esp + 0x20], ebx
call fcn.0040e9b5
mov dword [esp + 0x28], eax
cmp byte [eax + 0x1c], 0
je 0x40d277
xor eax, eax
jmp 0x40d6b6
push dword [ebp + 8]
mov ecx, ebx
call fcn.0040e9b5
mov ecx, esi
push dword [eax + 4]
call fcn.0040e296
mov ecx, dword [eax]
sub ecx, 0x10
call fcn.0040ab13
push dword [ebp + 8]
mov ecx, ebx
lea edi, [eax + 0x10]
mov dword [esp + 0x38], edi
mov dword [esp + 0x30], edi
call fcn.0040e9b5
add eax, 0x18
lea edx, [esp + 0x2c]
push eax
lea ecx, [esp + 0x14]
call fcn.004098cf
mov eax, dword [esp + 0x2c]
pop ecx
push edi
lea ecx, [esp + 0x28]
mov eax, dword [eax + 0xc]
mov dword [esp + 0x24], eax
call fcn.00404f61
lea edx, [esp + 0x24]
lea ecx, [esp + 0x30]
call fcn.0040b7ba
push dword [eax]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov ecx, dword [esp + 0x30]
lea ebx, [eax - 1]
neg ebx
sbb bl, bl
add ecx, 0xfffffff0
call fcn.004052ff
mov ecx, dword [esp + 0x24]
lea ecx, [ecx - 0x10]
call fcn.004052ff
add bl, 1
jne 0x40d329
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x14]
mov ecx, esi
push eax
push 0x104
call fcn.0040e256
push 0xe
jmp 0x40d3be
push 0
push dword [esp + 0x24]
mov ecx, edi
call fcn.00419971
mov ebx, dword [ebp + 0xc]
pop ecx
pop ecx
test al, al
jne 0x40d3c8
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x40d359
mov eax, dword [ecx]
push 0
push dword [esp + 0x24]
push edi
call dword [eax]
test eax, eax
jne 0x40d3c8
cmp byte [0x449ac4], 0
je 0x40d3bc
mov eax, dword [esp + 0x28]
lea edx, [esp + 0x2c]
add eax, 0x18
lea ecx, [esp + 0x28]
push eax
call fcn.004098cf
pop ecx
lea ecx, [esp + 0x30]
mov ebx, dword [eax]
call fcn.00415236
mov esi, eax
push str.Not_enough_disk_space_to_extract_file:
mov ecx, esi
call fcn.004028da
push ebx
mov ecx, esi
call fcn.0041524a
push eax
mov ecx, 0x449a94
call fcn.0041466e
mov ecx, dword [esp + 0x30]
lea ecx, [ecx - 0x10]
call fcn.004052ff
mov ecx, dword [esp + 0x28]
lea ecx, [ecx - 0x10]
call fcn.004052ff
push 0xa
mov esi, dword [esp + 0x14]
pop ebx
jmp 0x40d6a4
push dword [ebp + 8]
lea ecx, [esi + 0x78]
call fcn.0040e9b5
mov ebx, dword [ebx]
mov dword [esp + 0x24], ebx
mov eax, dword [eax + 4]
mov dword [esp + 0x30], eax
test ebx, ebx
je 0x40d423
push dword [ebp + 8]
mov ecx, dword [esp + 0x20]
mov esi, dword [ebx]
call fcn.0040e9b5
push 0
mov ecx, ebx
push dword [eax + 0xc]
call dword [esi + 0x1c]
push dword [ebp + 8]
mov ecx, dword [esp + 0x20]
mov esi, dword [ebx]
call fcn.0040e9b5
lea ecx, [esp + 0x10]
push dword [eax]
call fcn.0040b458
push eax
mov ecx, ebx
call dword [esi + 0x14]
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x30]
cmp eax, 0xc
jne 0x40d438
lea eax, [esp + 0x10]
push eax
lea ecx, [esi + 0xa4]
call fcn.00409766
lea eax, [esi + 0xb0]
xor dl, dl
push eax
lea ecx, [esp + 0x14]
call fcn.0040b60a
mov esi, dword [esp + 0x14]
xor eax, eax
pop ecx
push eax
push 0x80
push 2
push eax
push eax
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x2c], eax
cmp eax, 0xffffffff
jne 0x40d511
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x14]
push eax
lea eax, [esp + 0x14]
push eax
push 0x104
call fcn.0040e256
cmp byte [0x449ac4], 0
je 0x40d572
push ecx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [esp + 0x28]
call fcn.0041a559
pop ecx
lea ecx, [esp + 0x28]
mov eax, dword [eax]
mov dword [esp + 0x30], eax
call fcn.00415236
mov ebx, eax
push str.Failed_to_extract_file:
mov ecx, ebx
call fcn.004028da
push esi
mov ecx, ebx
call fcn.0041524a
mov ebx, eax
push str._Error:
mov ecx, ebx
call fcn.004028da
push dword [esp + 0x30]
mov ecx, ebx
call fcn.0041524a
push eax
mov ecx, 0x449a94
call fcn.0041466e
mov ecx, dword [esp + 0x28]
lea ecx, [ecx - 0x10]
call fcn.004052ff
mov ecx, dword [esp + 0x24]
lea ecx, [ecx - 0x10]
call fcn.004052ff
jmp 0x40d572
mov ebx, dword [esp + 0x14]
push dword [ebp + 8]
mov ecx, dword [esp + 0x20]
mov eax, dword [ebx + 0x58]
mov ebx, dword [ebx + 0x5c]
mov dword [esp + 0x34], eax
call fcn.0040e9b5
push 0
mov ecx, dword [eax + 0x10]
xor eax, eax
add ecx, dword [esp + 0x34]
mov dword [esp + 0x3c], ecx
adc eax, ebx
mov ebx, dword [esp + 0x18]
mov dword [esp + 0x40], eax
lea eax, [esp + 0x40]
push eax
push ecx
push dword [ebx + 0x84]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40d57a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebx + 0x60]
mov ecx, ebx
push eax
push 0x103
call fcn.0040e256
push 2
pop ebx
jmp 0x40d695
mov eax, 0x10000
push 0x43a4f1
push eax
call fcn.00424bbb
and dword [ebx + 0xd0], 0
mov edi, eax
pop ecx
pop ecx
push dword [ebp + 8]
lea ecx, [ebx + 0x78]
call fcn.0040e9b5
push dword [ebp + 8]
lea ecx, [ebx + 0x78]
mov eax, dword [eax + 8]
shr eax, 1
and eax, 0xffffff01
mov dword [esp + 0x34], eax
call fcn.0040e9b5
and dword [esp + 0x20], 0
mov ecx, dword [esp + 0x24]
mov edx, dword [eax + 0xc]
mov dword [esp + 0x10], edx
test ecx, ecx
je 0x40d5de
mov eax, dword [ecx]
call dword [eax + 0x24]
test al, al
jne 0x40d6bf
mov edx, dword [esp + 0x10]
push 0
mov ecx, 0x10000
lea eax, [esp + 0x1c]
push eax
cmp edx, ecx
mov eax, edx
cmova eax, ecx
push eax
push edi
push dword [ebx + 0x84]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40d678
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40d678
cmp byte [esp + 0x30], 0
je 0x40d623
push eax
push edi
lea ecx, [ebx + 0xc8]
call fcn.0041c560
mov eax, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x1c]
push ecx
push eax
push edi
push dword [esp + 0x3c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40d678
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40d678
mov edx, dword [esp + 0x10]
add dword [esp + 0x20], eax
sub edx, eax
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x10], edx
test ecx, ecx
je 0x40d670
mov eax, dword [esp + 0x20]
mov ebx, dword [ecx]
cdq
push edx
push eax
call dword [ebx + 0x20]
mov ebx, dword [esp + 0x14]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x10]
test edx, edx
jg 0x40d5c9
push dword [ebp + 8]
mov ecx, dword [esp + 0x20]
call fcn.0040e9b5
xor ebx, ebx
mov byte [eax + 0x1c], 1
push edi
call fcn.00424704
mov edi, dword [esp + 0x38]
pop ecx
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40d6a4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esi - 0x10]
call fcn.004052ff
lea ecx, [edi - 0x10]
call fcn.004052ff
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0xf
pop ebx
jmp 0x40d68a