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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4ec
mov eax, dword [0x425004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
push esi
push edi
mov dword [ebp - 0x458], ebx
mov eax, dword [ebx + 0x18]
cmp eax, 0xffffffff
je 0x4049e6
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [ebp - 0x42c]
push 0
push ecx
push 1
lea ecx, [ebp - 0x431]
push ecx
push eax
call esi
test eax, eax
je 0x4049e6
movzx eax, byte [ebp - 0x431]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 0xc
ja case.default.0x4040d3
jmp dword [eax*4 + 0x404a18]
push 0
lea eax, [ebp - 0x42c]
push eax
push 4
lea eax, [ebx + 0x21c]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
mov ecx, ebx
call fcn.004018b0
push 0
mov dword [ebp - 0x444], eax
lea eax, [ebp - 0x484]
push eax
push 4
lea eax, [ebp - 0x444]
push eax
push dword [ebx + 0x18]
call edi
cmp dword [ebp - 0x444], 0
je case.default.0x4040d3
xor eax, eax
cmp dword [ebx + 0x230], eax
push 0
setne al
mov dword [ebp - 0x444], eax
lea eax, [ebp - 0x484]
push eax
push 4
lea eax, [ebp - 0x444]
push eax
push dword [ebx + 0x18]
call edi
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x42c]
push eax
push 8
lea eax, [ebp - 0x4e8]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
mov eax, dword [ebp - 0x4e8]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
mov ecx, dword [ebx + 0x22c]
test ecx, ecx
je case.default.0x4040d3
mov dword [ebp - 0x438], 0
lea edx, [ebp - 0x44c]
mov eax, dword [ecx]
push edx
push ecx
call dword [eax + 0x68]
test eax, eax
jne 0x404345
mov dword [ebp - 0x430], eax
lea edx, [ebp - 0x43c]
mov eax, dword [ebp - 0x44c]
push edx
push eax
mov ecx, dword [eax]
call dword [ecx + 0x18]
mov eax, dword [ebp - 0x43c]
shl eax, 2
push eax
call fcn.00410c17
mov ecx, dword [ebp - 0x44c]
lea esi, [ebp - 0x43c]
add esp, 4
mov dword [ebp - 0x440], eax
mov edx, dword [ecx]
push esi
push eax
push dword [ebp - 0x43c]
push ecx
call dword [edx + 0x1c]
mov eax, dword [ebp - 0x43c]
push 0
mov dword [ebp - 0x438], eax
lea eax, [ebp - 0x448]
push eax
push 4
lea eax, [ebp - 0x438]
push eax
push dword [ebx + 0x18]
call edi
xor esi, esi
cmp dword [ebp - 0x43c], esi
jbe 0x404306
nop word [eax + eax]
mov eax, dword [ebp - 0x440]
push 0
mov eax, dword [eax + esi*4]
cdq
mov dword [ebp - 0x4d0], eax
lea eax, [ebp - 0x448]
push eax
push 8
lea eax, [ebp - 0x4d0]
mov dword [ebp - 0x4cc], edx
push eax
push dword [ebx + 0x18]
call edi
mov eax, dword [ebp - 0x440]
lea edx, [ebp - 0x208]
mov dword [ebp - 0x430], 0
push edx
lea edx, [ebp - 0x430]
mov eax, dword [eax + esi*4]
push edx
push 0xff
push eax
mov ecx, dword [eax]
call dword [ecx + 0x4c]
mov eax, dword [ebp - 0x430]
add eax, eax
push 0
mov dword [ebp - 0x430], eax
lea eax, [ebp - 0x448]
push eax
push 4
lea eax, [ebp - 0x430]
push eax
push dword [ebx + 0x18]
call edi
push 0
lea eax, [ebp - 0x448]
push eax
push dword [ebp - 0x430]
lea eax, [ebp - 0x208]
push eax
push dword [ebx + 0x18]
call edi
inc esi
cmp esi, dword [ebp - 0x43c]
jb 0x404260
mov eax, dword [ebp - 0x440]
test eax, eax
je 0x404319
push eax
call fcn.004109b7
add esp, 4
mov eax, dword [ebp - 0x44c]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x448]
push eax
push 4
lea eax, [ebp - 0x438]
push eax
push dword [ebx + 0x18]
call edi
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x42c]
push eax
push 8
lea eax, [ebp - 0x4d8]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
push dword [ebp - 0x4d4]
mov ecx, ebx
push dword [ebp - 0x4d8]
call fcn.00401ff0
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x42c]
push eax
push 8
lea eax, [ebp - 0x4e0]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
push dword [ebp - 0x4dc]
mov ecx, ebx
push dword [ebp - 0x4e0]
call fcn.00402470
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x42c]
push eax
push 8
lea eax, [ebp - 0x4a0]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
push 0
lea eax, [ebp - 0x42c]
push eax
push 4
lea eax, [ebp - 0x488]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
push dword [ebp - 0x488]
mov ecx, ebx
push dword [ebp - 0x49c]
push dword [ebp - 0x4a0]
call fcn.004026c0
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x42c]
push eax
push 8
lea eax, [ebp - 0x4a8]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
push 0
lea eax, [ebp - 0x42c]
push eax
push 4
lea eax, [ebp - 0x48c]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
push dword [ebp - 0x48c]
lea eax, [ebp - 0x428]
push dword [ebp - 0x4a4]
push dword [ebp - 0x4a8]
push eax
call fcn.00403060
mov eax, dword [ebp - 0x428]
or eax, dword [ebp - 0x424]
jne 0x404543
mov eax, dword [ebp - 0x420]
or eax, dword [ebp - 0x41c]
jne 0x404543
mov dword [ebp - 0x438], 0xffffffff
lea edi, [ebp - 0x438]
xor esi, esi
nop dword [eax]
push 0
lea eax, [ebp - 0x474]
push eax
push 4
push edi
push dword [ebx + 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4049fc
add esi, dword [ebp - 0x474]
add edi, dword [ebp - 0x474]
cmp esi, 4
jb 0x404510
jmp 0x404325
movups xmm0, xmmword [ebp - 0x428]
sub esp, 0x10
mov ecx, ebx
mov eax, esp
movups xmmword [eax], xmm0
call fcn.004032b0
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x42c]
push eax
push 8
lea eax, [ebp - 0x4b0]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
push 0
lea eax, [ebp - 0x42c]
push eax
push 4
lea eax, [ebp - 0x494]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
push dword [ebp - 0x494]
mov ecx, ebx
push dword [ebp - 0x4ac]
push dword [ebp - 0x4b0]
call fcn.00402c70
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x42c]
push eax
push 8
lea eax, [ebp - 0x4b8]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
push 0
lea eax, [ebp - 0x42c]
push eax
push 4
lea eax, [ebp - 0x490]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
push dword [ebp - 0x490]
mov ecx, ebx
push dword [ebp - 0x4b4]
push dword [ebp - 0x4b8]
call fcn.00402840
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x42c]
push eax
push 8
lea eax, [ebp - 0x4c0]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je 0x4049e6
mov eax, dword [ebp - 0x4c0]
xorps xmm0, xmm0
mov ecx, dword [ebx + 0x230]
mov dword [ebp - 0x440], eax
mov eax, dword [ebp - 0x4bc]
mov dword [ebp - 0x430], eax
movlpd qword [ebp - 0x468], xmm0
mov dword [ebp - 0x438], 0
test ecx, ecx
je 0x404792
mov eax, dword [ecx]
lea edx, [ebp - 0x45c]
push edx
push ecx
call dword [eax + 0x10]
test eax, eax
jne 0x404792
nop dword [eax]
nop dword [eax + eax]
mov eax, dword [ebp - 0x45c]
lea edx, [ebp - 0x454]
push edx
lea edx, [ebp - 0x208]
push edx
mov ecx, dword [eax]
push 0x10
push eax
call dword [ecx + 0x1c]
xor esi, esi
mov dword [ebp - 0x498], eax
cmp dword [ebp - 0x454], esi
jbe 0x40475d
mov eax, dword [ebp - 0x430]
lea ecx, [ebp - 0x200]
mov ebx, dword [ecx - 4]
mov edi, dword [ecx - 8]
cmp eax, ebx
jb 0x404745
ja 0x40471c
cmp dword [ebp - 0x440], edi
jb 0x404745
mov edx, dword [ecx]
mov eax, dword [ecx + 4]
add edx, edi
adc eax, ebx
cmp dword [ebp - 0x430], eax
jb 0x4047c3
ja 0x40473f
cmp dword [ebp - 0x440], edx
jb 0x4047c3
mov eax, dword [ebp - 0x430]
inc esi
add ecx, 0x20
cmp esi, dword [ebp - 0x454]
jb 0x404708
mov ebx, dword [ebp - 0x458]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebp - 0x498], 0
jne 0x404773
cmp dword [ebp - 0x438], 0
je 0x4046d0
mov eax, dword [ebp - 0x45c]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
cmp dword [ebp - 0x438], 0
jne 0x404325
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [ebp - 0x478]
push eax
push 8
lea eax, [ebp - 0x468]
push eax
push dword [ebx + 0x18]
call edi
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x478]
mov dword [ebp - 0x464], ebx
mov ebx, dword [ebp - 0x458]
push eax
push 8
lea eax, [ebp - 0x468]
mov dword [ebp - 0x468], edi
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
push eax
push dword [ebx + 0x18]
mov dword [ebp - 0x438], 1
call edi
shl esi, 5
sub esp, 0x10
mov eax, esp
mov ecx, ebx
movups xmm0, xmmword [ebp + esi - 0x1f8]
movups xmmword [eax], xmm0
call fcn.004032b0
jmp 0x40475d
mov ecx, ebx
call fcn.00403d80
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
push 0
lea eax, [ebp - 0x42c]
push eax
push 8
lea eax, [ebp - 0x4c8]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je case.default.0x4040d3
push 0
lea eax, [ebp - 0x42c]
push eax
push 4
lea eax, [ebp - 0x47c]
push eax
push dword [ebx + 0x18]
call esi
test eax, eax
je case.default.0x4040d3
push dword [ebp - 0x47c]
lea eax, [ebp - 0x418]
push dword [ebp - 0x4c4]
push dword [ebp - 0x4c8]
push eax
call fcn.00403060
mov eax, dword [ebp - 0x418]
or eax, dword [ebp - 0x414]
jne 0x4048b8
mov eax, dword [ebp - 0x410]
or eax, dword [ebp - 0x40c]
je 0x404997
mov ecx, dword [ebx + 0x230]
test ecx, ecx
je 0x404997
mov eax, dword [ecx]
lea edx, [ebp - 0x480]
push edx
push ecx
call dword [eax + 0x10]
test eax, eax
jne 0x404997
nop dword [eax + eax]
mov eax, dword [ebp - 0x480]
lea edx, [ebp - 0x460]
push edx
lea edx, [ebp - 0x408]
push edx
mov ecx, dword [eax]
push 0x20
push eax
call dword [ecx + 0x1c]
test eax, eax
jne 0x40498b
mov ecx, dword [ebp - 0x460]
test ecx, ecx
je 0x4048e0
xor edi, edi
test ecx, ecx
je 0x4048e0
lea esi, [ebp - 0x3f0]
nop word [eax + eax]
mov eax, dword [ebp - 0x418]
cmp eax, dword [esi - 8]
jne 0x40497e
mov eax, dword [ebp - 0x414]
cmp eax, dword [esi - 4]
jne 0x40497e
mov eax, dword [ebp - 0x410]
cmp eax, dword [esi]
jne 0x40497e
mov eax, dword [ebp - 0x40c]
cmp eax, dword [esi + 4]
jne 0x40497e
mov eax, dword [esi - 0x18]
mov dword [ebp - 0x470], eax
mov eax, dword [esi - 0x14]
push 0
mov dword [ebp - 0x46c], eax
lea eax, [ebp - 0x450]
push eax
push 8
lea eax, [ebp - 0x470]
push eax
push dword [ebx + 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x460]
inc edi
add esi, 0x20
cmp edi, ecx
jb 0x404920
jmp 0x4048e0
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [ebp - 0x450]
xorps xmm0, xmm0
push eax
push 8
lea eax, [ebp - 0x470]
movlpd qword [ebp - 0x470], xmm0
push eax
push dword [ebx + 0x18]
call edi
push 0
lea eax, [ebp - 0x42c]
push eax
push 1
lea eax, [ebp - 0x431]
push eax
push dword [ebx + 0x18]
jmp 0x4040b3
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405531
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00405531
mov esp, ebp
pop ebp
ret
push 0x424658
lea eax, [ebp - 0x450]
mov dword [ebp - 0x450], str.Write_Error
push eax
call fcn.004069d9
nop
fiadd dword [eax + 0x40]
add bl, dl
dec ecx
inc eax
add byte [ecx + eax*2 + 0x40], ch
add byte [ecx + 0x76004041], dh
inc ebx
inc eax
add dl, al
inc ebx
inc eax
add byte [ebx + 0x45], dh
inc eax
add byte [ebp + 0x46], dl
inc eax
add byte [ebx], bl
dec eax
inc eax
add byte [edi + 0x44], bh
inc eax
add ah, ah
inc ebp
inc eax
add byte [esi], cl
inc esp
inc eax
add byte [eax + ecx*2], bh
inc eax
add ah, cl
int3