Function at 0x408620
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x424c20
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2c
push ebx
push ebp
mov ebp, dword [esp + 0x44]
push esi
push edi
mov byte [esp + 0x13], 0
test byte [ebp], 1
je 0x4087ba
mov eax, dword [esp + 0x50]
xor ebx, ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x14], ebx
mov eax, dword [eax + 4]
cmp eax, ebx
jne 0x408669
mov eax, 0x426230
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push eax
call esi
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x18], edi
je 0x408836
mov ecx, dword [esp + 0x54]
mov eax, dword [ecx + 4]
cmp eax, ebx
jne 0x4086a1
mov eax, 0x426230
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push eax
call esi
mov ebx, eax
cmp ebx, 0xffffffff
je 0x408897
mov eax, dword [ebp + 0xc]
push 0x400
mov edi, eax
shr edi, 0xa
mov edx, edi
shl edx, 0xa
sub eax, edx
mov dword [esp + 0x58], eax
call fcn.00419194
mov esi, eax
xor eax, eax
add esp, 4
cmp esi, eax
je 0x4088fc
mov ecx, dword [esp + 0x18]
push eax
push eax
mov eax, dword [ebp + 0x10]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [esp + 0x50], 0
test edi, edi
jbe 0x40875e
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x4c]
push 0
push edx
push 0x400
push esi
push eax
call ebp
test eax, eax
je 0x40879f
cmp dword [esp + 0x4c], 0x400
jne 0x40879f
lea ecx, [esp + 0x14]
push 0
push ecx
push 0x400
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40879f
cmp dword [esp + 0x14], 0x400
jne 0x40879f
mov eax, dword [esp + 0x50]
inc eax
cmp eax, edi
mov dword [esp + 0x50], eax
jb 0x40870d
mov edi, dword [esp + 0x54]
test edi, edi
jbe 0x40879a
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x4c]
push 0
push edx
push edi
push esi
push eax
call ebp
test eax, eax
je 0x40879f
cmp dword [esp + 0x4c], edi
jne 0x40879f
lea ecx, [esp + 0x14]
push 0
push ecx
push edi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40879f
cmp dword [esp + 0x14], edi
jne 0x40879f
mov byte [esp + 0x13], 1
push esi
call fcn.0040c880
add esp, 4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 0x18]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
mov al, byte [esp + 0x50]
mov edi, str.Finish_CMainWindow::ExtractFile__.
mov byte [esp + 0x2c], al
or ecx, 0xffffffff
xor eax, eax
mov dword [esp + 0x30], ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x34], ebx
push ecx
push str.Finish_CMainWindow::ExtractFile__.
lea ecx, [esp + 0x34]
mov dword [esp + 0x40], ebx
call fcn.00402b60
lea ecx, [esp + 0x2c]
mov dword [esp + 0x44], 3
push ecx
call fcn.004012f0
mov ecx, eax
call fcn.00401360
mov eax, dword [esp + 0x30]
pop edi
pop esi
pop ebp
cmp eax, ebx
pop ebx
je 0x408981
lea ecx, [eax - 1]
mov al, byte [eax - 1]
test al, al
je 0x408978
cmp al, 0xff
je 0x408978
dec al
mov byte [ecx], al
jmp 0x408981
mov edx, dword [esp + 0x50]
lea eax, [esp + 0x1c]
push edx
push str.Cant_read_file:
push eax
call fcn.00403740
add esp, 0xc
push eax
mov dword [esp + 0x48], ebx
call fcn.004012f0
mov ecx, eax
call fcn.00401360
mov eax, dword [esp + 0x20]
mov dword [esp + 0x44], 0xffffffff
cmp eax, ebx
je 0x4087bc
lea ecx, [eax - 1]
mov al, byte [eax - 1]
test al, al
je 0x408889
cmp al, 0xff
je 0x408889
dec al
mov byte [ecx], al
jmp 0x4087bc
push ecx
call fcn.0040c880
add esp, 4
jmp 0x4087bc
mov ecx, dword [esp + 0x54]
lea edx, [esp + 0x1c]
push ecx
push str.Cant_read_file:
push edx
call fcn.00403740
add esp, 0xc
push eax
mov dword [esp + 0x48], 1
call fcn.004012f0
mov ecx, eax
call fcn.00401360
mov eax, dword [esp + 0x20]
mov dword [esp + 0x44], 0xffffffff
test eax, eax
je 0x4087b3
lea ecx, [eax - 1]
mov al, byte [eax - 1]
test al, al
je 0x4088ee
cmp al, 0xff
je 0x4088ee
dec al
mov byte [ecx], al
jmp 0x4087b3
push ecx
call fcn.0040c880
add esp, 4
jmp 0x4087b3
mov cl, byte [esp + 0x50]
mov dword [esp + 0x20], eax
mov byte [esp + 0x1c], cl
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov edi, str.Cant_NEW_pBuf.
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str.Cant_NEW_pBuf.
lea ecx, [esp + 0x24]
call fcn.00402b60
lea edx, [esp + 0x1c]
mov dword [esp + 0x44], 2
push edx
call fcn.004012f0
mov ecx, eax
call fcn.00401360
mov eax, dword [esp + 0x20]
mov dword [esp + 0x44], 0xffffffff
test eax, eax
je 0x4087a8
lea ecx, [eax - 1]
mov al, byte [eax - 1]
test al, al
je 0x408972
cmp al, 0xff
je 0x408972
dec al
mov byte [ecx], al
jmp 0x4087a8
push ecx
jmp 0x4087a0
push ecx
call fcn.0040c880
add esp, 4
mov ecx, dword [esp + 0x2c]
mov al, byte [esp + 3]
mov dword fs:[0], ecx
add esp, 0x38
ret 0xc