Function at 0x406f30
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x19c
push ebx
push ebp
push esi
mov esi, dword [esp + 0x1ac]
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
push edi
push 0
push 0x80
push 3
push 0
push 0
push closesocket
push esi
call ebx
cmp eax, 0xffffffff
je 0x406fd1
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x4307f0]
cmp eax, 8
je 0x406f86
cmp eax, 3
je 0x406f86
mov eax, dword [0x422828]
push esi
mov ecx, dword [eax + 0x118]
push ecx
jmp 0x406f93
mov eax, dword [0x422828]
mov ecx, dword [eax + 0x118]
push ecx
push esi
lea edx, [esp + 0x4c]
push str._s__s_
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [esp + 0x44]
push 1
push 0x4210b4
push eax
call dword [sym.imp.USER32.dll_GetFocus]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 2
jne 0x406fd1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x19c
ret
push str.pcard___.jpg
call fcn.00418c3d
mov ecx, dword [esp + 0x1bc]
mov edx, dword [esp + 0x1b8]
push ecx
push edx
push str.pcard___.jpg
call fcn.00406570
add esp, 0x10
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
push esi
call ebx
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x14], esi
jne 0x407025
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x19c
ret
push 0
push 0x80
push 3
push 0
push 0
push closesocket
push str.exemain
call ebx
mov edi, eax
cmp edi, 0xffffffff
jne 0x407059
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x19c
ret
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
push 0
push 0
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [esp + 0x1c], esi
test esi, esi
jle 0x4070c7
cmp esi, 0x1000
push 0
jle 0x407095
lea eax, [esp + 0x14]
push eax
push 0x1000
jmp 0x40709b
lea ecx, [esp + 0x14]
push ecx
push esi
push 0x4295a0
push edi
call ebp
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x18]
push 0
push edx
push eax
push 0x4295a0
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esi, dword [esp + 0x10]
test esi, esi
jg 0x40707f
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call esi
push 0
push 0x80
push 3
push 0
push 0
push closesocket
push str.pcard___.jpg
call ebx
mov edi, eax
cmp edi, 0xffffffff
jne 0x407104
mov edx, dword [esp + 0x14]
push edx
call esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x19c
ret
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
push 0
push 0
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x1c]
add eax, esi
test esi, esi
mov dword [0x436964], eax
jle 0x407173
cmp esi, 0x1000
push 0
jle 0x407141
lea ecx, [esp + 0x14]
push ecx
push 0x1000
jmp 0x407147
lea edx, [esp + 0x14]
push edx
push esi
push 0x4295a0
push edi
call ebp
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x18]
push 0
push eax
push ecx
push 0x4295a0
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esi, dword [esp + 0x10]
test esi, esi
jg 0x40712b
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
lea eax, [esi + 1]
mov dword [esp + 0x20], eax
push eax
lea eax, [esp + 0x48]
push str.ctrl_d.jpg
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov edx, dword [0x430f70]
lea edi, [esp + esi*4 + 0x30]
lea ebx, [esp + esi*4 + 0x40]
push edi
lea ecx, [esp + 0x54]
push ebx
push ecx
push edx
call fcn.00407540
mov eax, dword [ebx]
mov ecx, dword [0x430f70]
mov esi, dword [edi]
add esp, 0x1c
push 0
push 0
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test esi, esi
jle 0x407225
cmp esi, 0x1000
push 0
jle 0x4071ed
mov eax, dword [0x430f70]
lea edx, [esp + 0x14]
push edx
push 0x1000
push 0x4295a0
push eax
jmp 0x4071ff
mov edx, dword [0x430f70]
lea ecx, [esp + 0x14]
push ecx
push esi
push 0x4295a0
push edx
call ebp
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x18]
push 0
push eax
push ecx
push 0x4295a0
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esi, dword [esp + 0x10]
test esi, esi
jg 0x4071cc
mov esi, dword [esp + 0x20]
cmp esi, 4
jl 0x40717c
mov eax, dword [esp + 0x24]
mov ecx, dword [0x436964]
mov edx, dword [esp + 0x28]
add eax, ecx
mov ecx, dword [esp + 0x2c]
mov dword [0x436968], eax
add eax, edx
mov dword [0x43696c], eax
add eax, ecx
mov ecx, dword [0x422a84]
mov dword [0x436970], eax
mov eax, 1
cmp ecx, eax
jne 0x40729f
cmp dword [0x4228bc], eax
jne 0x40729f
mov esi, dword [sym.imp.USER32.dll_GetFocus]
push 0x4228a8
call esi
push eax
call fcn.004012a0
add esp, 8
test eax, eax
je 0x407295
call esi
push eax
call fcn.00401720
add esp, 4
xor ebx, ebx
mov dword [0x4228bc], ebx
jmp 0x4072a1
xor ebx, ebx
push ebx
push 0x80
push 3
push ebx
push ebx
push closesocket
push 0x4228a8
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4072ca
mov dword [0x436974], ebx
jmp 0x407337
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, ebx
jle 0x40731e
cmp esi, 0x1000
push ebx
jle 0x4072ed
lea edx, [esp + 0x14]
push edx
push 0x1000
jmp 0x4072f3
lea eax, [esp + 0x14]
push eax
push esi
push 0x4295a0
push edi
call ebp
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x18]
push ebx
push ecx
push edx
push 0x4295a0
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esi, dword [esp + 0x10]
cmp esi, ebx
jg 0x4072d8
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x30]
mov edx, dword [0x436970]
add edx, ecx
mov dword [0x436974], edx
mov eax, dword [esp + 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x435380
push 0x436978
mov dword [0x436a50], 0x23693330
mov dword [0x436a4c], ebx
mov dword [0x436a48], 0x120
mov dword [0x436960], eax
call esi
push 0x430f80
push 0x4369f8
call esi
mov esi, dword [esp + 0x14]
lea ecx, [esp + 0x18]
push ebx
push ecx
push 0xf4
push 0x436960
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.pcard___.jpg
call fcn.00418c3d
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x19c
ret